
系统运维
10个mysql5.7+php7+nginx源码编译安装时常见的问题
1.可以运行PHP,无法连接mysql数据库
php7 Call to undefined function mysql_connect()
The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.
解决方法:网络上一般都说是需要在Php.ini里增加mysql扩展,建议先php -m查看是否已经加载了mysqli,mysqlnd,如果没有该配置没...

程序设计
Nginx配置虚拟目录发布PHP程序的配置实例
nginx配置虚拟目录发布PHP,经常出现”file not found”\”Primary scrIPt unknown”等错误,可以参考以下nginx.conf配置
虚拟目录为/wordpress,程序目录/usr/local/wordpress
location /wordpress {
alias /usr/local/wordpress;
index index.php index.html index.htm;
}
location ~ /wordpress/.+\.php.*$ {
if ($fas...

系统运维
php-fpm:No pool defined解决方法
[root@localhost etc]# service php-fpm start
Starting php-fpm [28-Nov-2016 17:13:23] WARNING: Nothing matches the include pattern ‘/usr/local/php/etc/php-fpm.d/*.conf’ from /usr/local/php/etc/php-fpm.conf at line 125.
[28-Nov-2016 17:13:23] ERROR: No pool defined. at least one pool section must be specifi...

系统运维
执行phpize提示Cannot find autoconf
Centos下执行phpize提示“Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this scrIPt.”
原因:缺少autoconf
解决方法:
yum install autoconf

系统运维
php-fpm启动/停止异常
centos7下启动php-fpm,提示:
service php-fpm start
Starting php-fpm [08-Oct-2016 20:32:54] ERROR: An another FPM instance seems to already listen on /tmp/php-fcgi.sock
[08-Oct-2016 20:32:54] ERROR: FPM initialization failed.
查看进程可以或者log文件可以看到php-fpm已正常运行
service php-fpm stop
Gracefully shutting dow...

系统运维
phpmyadmin配置文件权限错误,不应任何用户都能修改
访问phpmyadmin提示“配置文件权限错误,不应任何用户都能修改”
原因:phpmyadmin目录权限过高,设置了777访问权限
解决:chmod -R 755 phpmyadin

程序设计
curl post提交出现HTTP Status 404的解决方法
curl post提交出现HTTP Status 404,解决方法如下:
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
使用http_build_query()将数组转换成url 问号?后面的参数字符串,自动进行urlencode处理。

程序设计
curl: 35 – error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
PHP Curl post提交https站点,显示:
curl: 35 – error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
解决:
如果能登陆服务器,直接在服务器上用命令测试更直观,分别运行
curl https://www.itlogger.com –sslv3
curl https://www.itlogger.com –sslv2
curl https://www.itlogger.com –t...

程序设计
PHP程序验证码无法显示的解决方法
PHPOK程序后台登陆验证码无法显示,问题原因:某些文件修改后编码不正确,解决方法:使用notepad++打开你修改过的文件如数据库连接配置文件,格式-转化为utf8-无Bom编码,保存即可,其他PHP程序如WordPress在安装或修改主题时也常出现该问题,可参照以上解决方法

程序设计
Smarty error: unable to read resource: \”index.html\” in Smarty.class.php
PHP使用模板引擎smarty,读取模板出错提示:Warning: Smarty error: unable to read resource: \”index.html\” in libs\\Smarty.class.php on line 1095
问题原因:模板目录设置不正确
解决方法:在出错页面调用echo $Tpl->template_dir; 查看模板对应的位置,在配置文件里修改相应模板正确位置即可。