VPS侦探论坛

 找回密码
 注册
查看: 10278|回复: 10

开启opcache频见500,502错误

[复制链接]
发表于 2016-11-4 12:40:45 | 显示全部楼层 |阅读模式

使用的是lnmp1.2,php5.4.41,开启的是自带的zend opcache7.0.4. 系统是centos6.5
开启後多个网站出现502甚至500,于是将opcache配置参数移到[Zend ZendGuard Loader]的上方,并且将zend_extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/opcache.so" 的双引号去掉,改为:zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/opcache.so。

结果是其他网站如discuz、mediawiki、wecenter搭建的网站恢复正常,但discuz后台显示空白,而moodle搭建的网站出现500现象,及Command line scripts must define CLI_SCRIPT before requiring config.php错误提示。
vi /usr/local/php/var/log/php-fpm*log:
[04-Nov-2016 12:07:39] NOTICE: ready to handle connections
[04-Nov-2016 12:09:45] NOTICE: Finishing ...
[04-Nov-2016 12:09:45] NOTICE: exiting, bye-bye!
[04-Nov-2016 12:09:49] NOTICE: fpm is running, pid 9185
[04-Nov-2016 12:09:49] NOTICE: ready to handle connections
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9196, script '/home/wwrot/www/index.php' (request: "HEAD /index.php") execution timed out (347.266284 sec), terminating
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9194, script '/home/wwrot/www/home.php' (request: "GET /home.php") execution timed out (341.136443 sec), terminating
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9191, script '/home/wwrot/wiki/index.php' (request: "GET /index.php") execution timed out (351.090878 sec), terminating
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9196 exited on signal 15 (SIGTERM) after 900.019190 seconds from start
[04-Nov-2016 12:24:49] NOTICE: [pool www] child 10308 started
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9191 exited on signal 15 (SIGTERM) after 900.023240 seconds from start
[04-Nov-2016 12:24:49] NOTICE: [pool www] child 10309 started
[04-Nov-2016 12:24:49] WARNING: [pool www] child 9194 exited on signal 15 (SIGTERM) after 900.022998 seconds from start
[04-Nov-2016 12:24:49] NOTICE: [pool www] child 10310 started
[04-Nov-2016 12:26:54] NOTICE: Finishing ...
[04-Nov-2016 12:26:54] NOTICE: exiting, bye-bye!
[04-Nov-2016 12:26:57] NOTICE: fpm is running, pid 10921
[04-Nov-2016 12:26:57] NOTICE: ready to handle connections


vi /var/log/slow.log提示文件为空白,php-fpm.conf已经开启该错误记录

vi /home/wwwlogs/nginx_error.log:
2016/11/04 12:06:02 [crit] 7661#0: *1 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 117.44.16.115, server: 省略, request: "GET /topic/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "省略", referrer: "省略"
2016/11/04 12:06:04 [crit] 7661#0: *3 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 54.223.190.116, server: 省略, request: "GET /news/whzc/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "省略"
2016/11/04 12:26:56 [crit] 10512#0: *1 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 1.58.136.229, server: 省略, request: "GET 省略网址 HTTP/1.0", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "省略", referrer: "省略"
2016/11/04 12:26:57 [crit] 10512#0: *5 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: 123.125.71.109, server: 省略, request: "GET 省略网址 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "省略"


呼叫军哥,已经修改php-fpm的max_children到128,并调节min_children到20,discuz后台显示恢复正常,但moodle错误依旧
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-11-4 13:08:48 | 显示全部楼层


只按上面的日志,提示的文件执行超时

看一按指定贴502排查方法启用php慢日志和错误日志看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-11-4 13:46:17 | 显示全部楼层

php慢日志和错误日志已经启用,php的错误日志是放在什么位置的呢
; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-11-4 13:49:11 | 显示全部楼层



; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = Off
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-11-4 13:49:31 | 显示全部楼层

; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-11-4 13:54:53 | 显示全部楼层

查看到错误日志了,moodle下日志错误:

[04-Nov-2016 13:04:33 PRC] PHP Warning:  require_once(/home/wwrot/moodle/moodle/cache/lib.php): failed to open stream: No such file or directory in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 13:04:33 PRC] PHP Fatal error:  require_once(): Failed opening required '/home/wwrot/moodle/moodle/cache/lib.php' (include_path='/home/wwrot/moodle/moodle/lib/pear:.:/usr/local/php/lib/php') in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 13:04:35 PRC] PHP Warning:  require_once(/home/wwrot/moodle/moodle/cache/lib.php): failed to open stream: No such file or directory in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 13:04:35 PRC] PHP Fatal error:  require_once(): Failed opening required '/home/wwrot/moodle/moodle/cache/lib.php' (include_path='/home/wwrot/moodle/moodle/lib/pear:.:/usr/local/php/lib/php') in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 13:04:35 PRC] PHP Warning:  require_once(/home/wwrot/moodle/moodle/cache/lib.php): failed to open stream: No such file or directory in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 13:04:35 PRC] PHP Fatal error:  require_once(): Failed opening required '/home/wwrot/moodle/moodle/cache/lib.php' (include_path='/home/wwrot/moodle/moodle/lib/pear:.:/usr/local/php/lib/php') in /home/wwrot/moodle/moodle/lib/setup.php on line 606

[04-Nov-2016 11:47:01 PRC] PHP Warning:  require_once(/home/wwrot/moodle/moodle/cache/lib.php): failed to open stream: No such file or directory in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 11:47:01 PRC] PHP Fatal error:  require_once(): Failed opening required '/home/wwrot/moodle/moodle/cache/lib.php' (include_path='/home/wwrot/moodle/moodle/lib/pear:.:/usr/local/php/lib/php') in /home/wwrot/moodle/moodle/lib/setup.php on line 606
[04-Nov-2016 11:48:02 PRC] PHP Warning:  require_once(/home/wwrot/moodle/moodle/cache/lib.php): failed to open stream: No such file or directory in /home/wwrot/moodle/moodle/lib/setup.php on line 606

[ 本帖最后由 yanqzh 于 2016-11-4 13:55 编辑 ]
 楼主| 发表于 2016-11-4 13:57:37 | 显示全部楼层

discuz网站错误如下:

[04-Nov-2016 11:12:44 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 11:24:53 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 11:25:42 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 11:35:22 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 11:41:12 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 12:01:02 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 12:20:33 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 12:49:23 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
[04-Nov-2016 12:59:34 PRC] PHP Notice:  Undefined variable: _SERVER in /home/wwwroot/discuz/archiver/index.php on line 14
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-11-4 13:59:24 | 显示全部楼层

这是打开探针页时返回的错误:

[04-Nov-2016 10:52:32 Etc/GMT-8] PHP Fatal error:  Uncaught exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli prepare error: MySQL server has gone away' in /home/wwwroot/ask/system/Zend/Db/Statement/Mysqli.php:77
Stack trace:
#0 /home/wwwroot/ask/system/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('SELECT `aws_ses...')
#1 /home/wwwroot/ask/system/Zend/Db/Adapter/Mysqli.php(388): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'SELECT `aws_ses...')
#2 /home/wwwroot/ask/system/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Adapter_Mysqli->prepare('SELECT `aws_ses...')
#3 /home/wwwroot/ask/system/Zend/Db/Table/Abstract.php(1577): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select))
#4 /home/wwwroot/ask/system/Zend/Db/Table/Abstract.php(1392): Zend_Db_Table_Abstract->_fetch(Object(Zend_Db_Table_Select))
#5 /home/wwwroot/ask/system/Zend/Db/Table/Abstract.php(1357): Zend_Db_Table_Abstract->fetchAll('((`aws_sessions...')
#6 [internal function]: Zend_Db_Table_Abstract->find('9mslh1ih2daoh0f...')
#7 /home/wwwroot/ask/system/Zend in /home/wwwroot/ask/system/Zend/Db/Statement/Mysqli.php on line 77
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-11-6 18:50:07 | 显示全部楼层


军哥,麻烦回一下吖,谢谢!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-11-7 09:49:42 | 显示全部楼层



6楼 日志里显示你网站目录文件不存在,检测提示的 /home/wwrot/moodle。。。的目录和文件

7楼错误不清楚

8楼 显示数据库没运行
 楼主| 发表于 2016-11-7 10:53:15 | 显示全部楼层

原帖由 licess 于 2016-11-7 09:49 发表
6楼 日志里显示你网站目录文件不存在,检测提示的 /home/wwrot/moodle。。。的目录和文件

7楼错误不清楚

8楼 显示数据库没运行


网站目录文件是存在的,8楼的时候,数据库也是运行中的,因为其他网站正常打开
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-16 15:21 , Processed in 0.029135 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表