LNMP问题总结
问题1:php访问mysql,Call to undefined function mysql_pconnect()
1 、打开mysql拓展。
php.ini里面;extension=php_mysql.dll去掉前面的分号.
2、WINDOWS系统下,需要将PHP/libmysql.dll和php5.dll 拷贝至:windows/system32下。
问题2:nginx站点编码设置
vi /usr/local/nginx/conf/nginx.conf
http {
include mime.types;
default_type application/octet-stream;
charset utf-8;
。。。
include mime.types;
default_type application/octet-stream;
charset utf-8;
。。。
}
问题3:Class 'PDO' not found in ...
php.ini里面;extension=php_pdo.dll去掉前面的分号.
问题4:PDO中文乱码
$dbh = "mysql:host=xxx.xxx.xxx.xxx;dbname=xxDB";
$db = new PDO($dbh, 'user', 'password');
$db->exec("SET CHARACTER SET UTF8");
$db = new PDO($dbh, 'user', 'password');
$db->exec("SET CHARACTER SET UTF8");
问题5:mysql_pconnnect中文乱码
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or die( 'Could not open connection to server' );
@mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary",$gaSql['link']);
问题6:PHP Error Class 'SoapClient' not found
1、安装soap模块
2、windows下 php.ini 打开 extension=php_soap.dll ,linux 下打开extension=soap.so。
重启php_cgi
问题7:PHP Warning: file_put_contents(/var/www/xxx) : failed to open stream: Permission denied in
文件夹权限问题,用 chmod -R 0777 /var/www
作者:青羽