今天重启了zabbix_server环境下的httpd服务后,再次访问zabbix浏览器页面时,服务器返回500 ( 服务器内部错误),而不是返回错误提示。
这时候需要对开发环境做一些配置,帮助你快速查找问题原因,定位问题,解决问题。
找到 php的配置文件 /etc/php.ini
# 配置参数值:
display_errors = On
error_reporting = E_ALL | E_STRICT
重启apache 服务
systemctl restart httpd.service
这个时候,再次访问网页已经可以输出错误信息了。
例如以下这是我的错误信息
Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /usr/share/zabbix/include/classes/core/ZBase.php on line 279
Fatal error: require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/zabbix/include/classes/core/ZBase.php on line 279
解决方式为:
# chmod -R 755 /etc/zabbix/web