zabbix前端界面配置中,Cannot connect to the database. 报错:MySQL Server has Gone away 原因:PHP页面文件conf目录下缺少一个
zabbix前端界面配置中,Cannot connect to the database.
报错:MySQL Server has Gone away
原因:PHP页面文件conf目录下缺少一个数据库配置文件(zabbix.conf.php)解决:cd /usr/share/Nginx/html/zabbix/conf #进入网页根目录下(或者用find搜索zabbix.conf.php.example文件)mv zabbix.conf.php.example zabbix.conf.php #重命名文件vim zabbix.conf.php$DB['TYPE'] = 'Mysql';$DB['SERVER'] = '192.168.8.159';$DB['PORT'] = '0';$DB['DATABASE'] = 'zabbix01';$DB['USER'] = 'zabbix';$DB['PASSWord'] = 'zabbix';ZBX_SERVER = '192.168.8.158';$ZBX_SERVER_PORT = '10051';修改完重新刷新登录即可:账号admin/zabbix
PHP启动时配置文件显示:loaded configuration file none
1、查看php配置加载php -i | grep Load# 或者 php --iniLoaded Configuration File => (none)libXML Loaded Version => 209012、strace去追踪一下:strace /usr/local/php7/bin/php -i 2> /tmp/2.loggrep 'php.ini' /tmp/2.logopen("/usr/local/php7/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)open("/usr/local/php7/etc/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)write(1, "Configuration File (php.ini) Pat"..., 33) = 33把php.ini复制到/usr/local/php7/bin下,然后配置文件加载成功了,但是此处对我报错无用!!!和这种方法类似:直接把源码包中的php.ini-production拷贝到--with-config-file-path设置的路径下/usr/local/php/etc/php.ini(适用于php命令行,nginx访问)3、直接使用绝对配置路径即可,结合4重新刷新配置/usr/local/php7/sbin/php-fpm -t# php-fpm配置测试php-fpm 启动:php-fpm指定php.ini路径/usr/local/php7/sbin/php-fpm -c /usr/local/php7/etc/php-ini -y /usr/local/php7/etc/php-fpm.conf4、强制重启netstat -antup | grep 9000# 查看9000端口是否已监听killall php-fpm # 杀掉所有的php-fpm进程php-fpm# 重启php-fpm
nginx访问:
Http://192.168.8.158/index.php查看php配置信息
vim /usr/share/nginx/html/<?php phpinfo();?>
为php创建软链接时,ln -s /usr/local/php7/bin/* /usr/local/bin
/usr/local/php7/bin/php -v # 有php版本信息,说明正常
但是php -v报错,报错信息:-bash: /usr/bin/php: No such file or directory
1、确认path变量:[root@szx bin]# echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/binpath路径里面有/usr/local/sbin,在此目录下的软链接缺没用2、软连接放在/usr/bin下面就可以ln -s /usr/local/php7/bin/* /usr/binphp -v# 成功!!!猜测:php是到/usr/bin目录下进行查找指令的
yum install -y libzip-devel
configure: error: Package requirements (libzip >= 0.11) were not met: No package ‘libzip’
原因:libzip提示版本太低,yum自带的是0.10解决办法:1、直接更新源下载rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum --enablerepo=remi install libzip5-devel 2、编译安装,指定PKG_CONFIG_PATH,上面报错中其实有提示信息,让我们考虑调整PKG_CONFIG_PATH环境变量1) 先卸载已有yum remove libzip -y 2) 编译安装wget https://libzip.org/download/libzip-1.2.0.tar.gztar -zxvf libzip-1.2.0.tar.gz -C /usr/localcd /usr/local/libzip-1.2.0./configuremake && make install3) 添加环境变量--PKG_CONFIG_PATHexport PKG_CONFIG_PATH="/usr/local/lib/pkGConfig/"
--结束END--
本文标题: zabbix5.0源码编译部署过程中的报错
本文链接: https://lsjlt.com/news/389247.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0