首页 Linux正文

zabbix3.4 web界面的配置

王昊 Linux 2019-07-31 421 0

紧跟上一篇文章来进行zabbix的配置

Next step

把所有先决条件修改完整

vim /usr/local/php7/etc/php.ini

对照红色选项来修改

vim /usr/local/php7/etc/php.ini

post_max_size = 16M    
max_execution_time = 300
max_input_time = 300

增加php的扩展模块

PHP bcmath

进入php的解压目录

cd /usr/local/php-7.3.7/ext/bcmath/

通过命令生成configure文件

/usr/local/php7/bin/phpize

./configure -with-php-config=/usr/local/php7/bin/php-config

make && make install

成功后会有显示一个目录,里面有生成的bcmath.so

把此路径加入到php.ini里面

vim /usr/local/php7/etc/php.ini

extension = /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/bcmath.so

PHP sockets

cd /usr/local/php-7.3.7/ext/sockets/

/usr/local/php7/bin/phpize

./configure -with-php-config=/usr/local/php7/bin/php-config

make && make install

vim /usr/local/php7/etc/php.ini

extension = /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/sockets.so

PHP LDAP

cd /usr/local/php-7.3.7/ext/ldap/

/usr/local/php7/bin/phpize

./configure -with-php-config=/usr/local/php7/bin/php-config

错误提示:

configure: error: Cannot find ldap libraries in /usr/lib.

解决方法:

cp -frp /usr/lib64/libldap* /usr/lib/

make && make install

vim /usr/local/php7/etc/php.ini

extension = /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/ldap.so

PHP gettext

cd /usr/local/php-7.3.7/ext/gettext/

/usr/local/php7/bin/phpize

./configure -with-php-config=/usr/local/php7/bin/php-config

make && make install

vim /usr/local/php7/etc/php.ini

extension = /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/gettext.so

设置PHP的时区

vim /usr/local/php7/etc/php.ini

date.timezone = Asia/Shanghai

添加PHP gd FreeType支持

wget https://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz

tar xf freetype-2.9.tar.gz

cd freetype-2.9

./configure –prefix=/usr/local/freetype –enable-static –enable-shared

make && make install

添加PHP gd JPEG图像支持

tar xf jpegsrc.v9c.tar.gz

cd jpeg-9c

./configure –prefix=/usr/local/jpeg –enable-shared –enable-static

make && make install

cd /usr/local/php-7.3.7/ext/gd/

/usr/local/php7/bin/phpize

./configure –with-php-config=/usr/local/php7/bin/php-config –with-jpeg-dir=/usr/local/jpeg/ –with-freetype-dir –with-png-dir –with-zlib-dir –with-gd

make && make install

vim /usr/local/php7/etc/php.ini

extension = /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/gd.so

现在重启的话依然没有jpeg支持

原因是之前编译PHP的时候已经加载过GD了,所以不能再引入外部的gd.so

所以只能回到PHP安装目录下重新编译

注意:这里没有 –with-gd 选项,因为要在配置文件里通过extension 加载 gd.so

./configure \
--prefix=/usr/local/php7/ \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-mbstring \
--with-curl \
--enable-fpm \
--enable-mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-config-file-path=/usr/local/php7/etc/ \
--with-mysqli=mysqlnd \
--with-mysql-sock=/usr/local/mysql/mysql.sock

make clean

make && make install

还有一个问题,之前编译的gd.so 也是不能被加载的,要按上面的方法重新编译gd.so文件,一定要回去重新编译,我这里就不写重复的内容了

重启httpd

systemctl restart httpd

刷新zabbix界面

当先决条件全部为OK之后

点击 Next step

Next step

Next step

确认无误之后,Next step

点击“Download the configuration file”,下载配置文件,然后传到指定目录

Finish

Finish

登录:默认用户名密码:Admin / zabbix

登陆成功

版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

评论