配置zabbix数据库环境相关问题
修改php.ini文件不生效出现报错
明明已经修改了,/etc/php.ini文件,还是不能生效,计算机骗我了???我去排了一下错
解决方法:
首先根目录新建xx.php文件
//xx.php <?php echo phpinfo();
去查看一下,好像发现了什么,并且查看相关配置,确实修改了没有变化,计算机没有骗我
原来在这里
[root@kk php73]# ll total 112 drwxr-xr-x 2 root root 4096 Feb 20 2019 opt drwxr-xr-x 2 root root 4096 Jan 14 16:40 php.d -rw-r--r-- 1 root root 5016 Dec 17 22:02 php-fpm.conf drwxr-xr-x 2 root root 4096 Jan 14 16:40 php-fpm.d -rw-r--r-- 1 root root 63437 Dec 17 22:02 php.ini drwxr-xr-x 2 root root 4096 Feb 20 2019 pki drwxr-xr-x 5 root root 4096 Jan 14 16:40 pm drwxr-xr-x 2 root root 4096 Feb 20 2019 skel drwxr-xr-x 2 root root 4096 Jan 14 16:40 sysconfig drwxr-xr-x 4 root root 4096 Jan 14 16:40 X11 drwxr-xr-x 3 root root 4096 Jan 14 16:40 xdg drwxr-xr-x 2 root root 4096 Feb 20 2019 xinetd.d
然后我去里面再次修改一下
385 max_execution_time = 300 395 max_input_time = 300 406 memory_limit = 128M 693 post_max_size = 16M 845 upload_max_filesize = 2M 922 date.timezone = Asia/Shanghai
重启php-fpm
[root@kk php73]# systemctl restart php73-php-fpm.service
问题得到解决
终于到了这步
问题一:突然卡住了,我重启了服务器,zabbix的web页面到这步就没有了,重启后直接练/zabbix/的页面都加载不出来了,去网上找了一天的答案,无果,完全不知道哪里错了,提示只有一个500,后期有能力了会把这个坑填上
查看nginx错误日志,报错如下:
2020/01/19 22:07:37 [error] 4943#4943: *1657 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /code/wordpress/zabbix/include/classes/core/ZBase.php on line 278PHP message: PHP Fatal error: require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/opt/remi/php73/root/usr/share/pear:/opt/remi/php73/root/usr/share/php:/usr/share/pear:/usr/share/php') in /code/wordpress/zabbix/include/classes/core/ZBase.php on line 278" while reading response header from upstream, client: 223.116.166.46, server: www.hebbao.com, request: "GET /zabbix/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.hebbao.com"
解决方法:
[root@Kk ~]# chown -R www.www /etc/zabbix/ [root@Kk ~]# chown -R www.www /usr/lib/zabbix/ [root@Kk ~]# chmod -R 755 /etc/zabbix/web/ [root@Kk ~]# chmod -R 777 /var/lib/php/session/ [root@Kk ~]# find / -name "session" /var/opt/remi/php73/lib/php/session /var/lib/php/session [root@Kk ~]# chmod -R 777 /var/opt/remi/php73/lib/php/session [root@Kk ~]# systemctl reload nginx [root@Kk ~]# systemctl restart zabbix-server
问题二:关联云数据库,因为不和主机不是一个地区,用的外网地址,怎么都识别不出来,卡住了,继后期要是有时间,也会把这个坑填上
出现错误Cannot connect to the database.(此问题卡住了)
问题三:2020/01/20 02:05:26 [error] 21211#21211: *220 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Cannot start session. in /code/zabbix/include/classes/core/CSession.php:46
Stack trace:
试了虚拟机,再虚拟机上部署了LNMP,zabbix,出现了相同的结果,真是头都大了,去看了nginx的日志
2020/01/20 02:05:26 [error] 21211#21211: *220 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Cannot start session. in /code/zabbix/include/classes/core/CSession.php:46 Stack trace: #0 /code/zabbix/setup.php(60): CSession::start() #1 {main} thrown in /code/zabbix/include/classes/core/CSession.php on line 46" while reading response header from upstream, client: 192.168.5.1, server: hedan.com, request: "GET /zabbix/setup.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "hedan.com"
头大啊,按日至提示去看一下/code/zabbix/include/classes/core/CSession.php on line 46
public static function start() { if (!self::$session_created) { ob_start(); session_set_cookie_params(0, self::getDefaultCookiePath(), null, HTTPS, true); if (!session_start()) { throw new Exception('Cannot start session.'); } session_write_close(); ob_flush(); self::$session_created = true; } } #可以看出来提示了错误关于session的,应该是权限不足
解决方法:
- 查一下有关session的文件
[root@zabbix conf.d]# find / -name "session" /var/lib/php/session /var/opt/remi/php73/lib/php/session
- 把这两个文件权限设置一下
[root@zabbix conf.d]# chmod -R 777 /var/lib/php/session/ [root@zabbix conf.d]# chmod 777 /var/opt/remi/php73/lib/php/session/ [root@zabbix conf.d]# systemctl reload nginx [root@zabbix conf.d]# systemctl restart zabbix-server
终于见到了曙光
问题,netstat -lntup|grep zabbix看不见端口号,但是启动zabbix-server正常
解决:
- /etc/zabbix/zxabbix-server中
- DBPasswd=密码没有输对
- 然后重启zabbix-server
继续阅读

我的微信
这是我的微信扫一扫
评论