amh5.3面板 php7 无法启动 导致网站502错误 解决办法

来源: 老季博客
日期: 2017-9-17
作者: 腾讯云/服务器VPS推荐评测/Vultr
阅读数: 58

amh面板确实给我们大家带来了方便,但是如果出错的话也不容易解决,需要一些基础才行。

Centos Debian Ubuntu Amh面板 安装图文教程

这里我们记录一下安装amh5.3面板后,php无法启动,导致网站出现502错误。

PS:正好是周末,即使去amh官方提交工单,也没人回应。

之前并不知道做了什么升级或者操作,这里网站直接出现了502 Bad Getway。

然后我们登录了amh面板,发现里面所有的php7.0都无法启动了。幸运的是我们开启了日志,果断查看日志。

[title]检查php日志:[/title]

cat /home/wwwroot/lnmp70/logs/147hub.com-php-fpm.log

错误如下错误:

[21-Aug-2017 11:07:45] ERROR: Unable to remove the PID file (/home/wwwroot/lnmp70/logs/147hub.com-php-fpm.pid).: No such file or directory (2)
[17-Sep-2017 10:36:42] ERROR: Unable to remove the PID file (/home/wwwroot/lnmp70/logs/147hub.com-php-fpm.pid).: No such file or directory (2)

[title]检查nginx日志文件:[/title]

cat /home/wwwroot/lnmp70/logs/147hub.com-error.log

2017/09/17 11:19:20 [crit] 10320#0: *173 connect() to unix:/tmp/php-cgi-lnmp70-147hub.com.sock failed (2: No such file or directory) while connecting to upstream, client: 121.41.112.148, server: 147hub.com, request: “HEAD / HTTP/1.1”, upstream: “fastcgi://unix:/tmp/php-cgi-lnmp70-147hub.com.sock:”, host: “147hub.com”

[title]检查php.ini:[/title]

最后没办法搜索一下php.ini的配置文件:

find / -name php.ini

发现了php.ini 的对应配置文件:

cat /home/wwwroot/lnmp70/etc/amh-php.ini

发现里面有写一句:

error_log = /home/wwwroot/lnmp70/logs/amh-php-errors.log

[title]查看最终的php7错误日志:[/title]

接着我们查看日志这个错误日志:

cat /home/wwwroot/lnmp70/logs/amh-php-errors.log

出现错误:

[17-Sep-2017 11:19:19 Asia/Shanghai] PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

然后我们检查了ionCube Loader扩展,发现这里并没有安装这个扩展,所以肯定会导致报错。

[title]修复错误:[/title]

直接把扩展安装上就能正常运行了。

链接到文章: https://jiloc.com/43451.html

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注