当前位置: > Linux发行版 > SuSE >

suse系统安装zabbix

时间:2019-05-10 17:18来源:未知 作者:IT
到安装界面如图:
 
此时配置有问题:

 
#cd /usr/local/src/services/apache2/conf
 
#vim httpd.conf
 
---配置zabbix目录访问权限:添加
<Directory "/usr/local//apache2/htdocs/">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
--修改初始化文件:
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
访问zabbix:
 
 
 
截图中的date.timedone这个改下路径应该在安装路径:/usr/local/src/services/php/etc/php.ini是配置php符合zabbix的要求配置文件
 
https://www.cnblogs.com/rusking/p/4471503.html
 
遠離塵世の方舟
 
尊重是自己赢得的,不是别人施舍的。
 
zabbix PHP databases support off Fail
zabbix初始化检查安装环境不通过:
 
PHP databases support off   Fail     --未找到所支持的数据库
 
处理方法:安装Mysqli模块
 
 ################
mysqli模块的安装
################
 
记得原来在编译php的已经已经加上参数
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
可后来找了一个,的确不存在mysqli.so,所以只能单独来编译mysqli了。
mysqli是优化过的mysql函数库,MYSQL版本不能低于4.1.12
cd /root/lamp/php-5.2.3/ext/mysqli
#####进入到mysqli的目录。
再用phpize生成configure文件:
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
#./configure --prefix=/usr/local/src/services/mysqli \
 
--with-php-config=/usr/local/src/services/php/bin/php-config \
 
--with-mysqli=/usr/local/src/services/mysql/bin/mysql_config
make 
make install
 
--报错:https://www.cnblogs.com/rusking/p/4471503.html
 
/usr/local/src/services/php/include/php/main/../main/php_config.h:2204:1: warning: this is the location of the previous definition
/usr/local/src/files/php-5.6.36/ext/mysqli/mysqli_api.c:36:47: error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory
make: *** [mysqli_api.lo] Error 1
解决:重新安装php,安装的时候直接把mysqli拓展加上:
 
PHP databases support MySQL OK
问题:
 
PHP bcmath off Fail
  解决:编译安装https://blog.csdn.net/asty9000/article/details/80675764
 
        1.进入PHP源码包目录下的ext/bcmath目录。
        2.执行phpize命令,phpize命令在PHP安装目录的bin目录下,如/usr/local/src/services/php/bin/phpize。
        3.执行./configure --with-php-config=/usr/local/src/services/php/bin/php-config。
        4.执行make && make install。
 
 cd  /usr/local/src/services/php/lib/php/extensions/no-debug-zts-20131226/
 
这个路径下有安装完的bcmath.so
 
 cp bcmath.so /usr/local/src/services/php/etc
        5.将安装完成后得到bcmath.so文件拷贝到php.ini中extension_dir配置的目录中。
        6.在Dynamic Extensions配置块下添加一行extension=bcmath.so。
        7.重启php服务即可。
 
还是失败:--with-php-config重新安装php
 
http://www.bubuko.com/infodetail-2051529.html
 
将生成的/usr/local/src/services/php/lib/php/extensions/no-debug-zts-20131226下的写到/etc/php.ini中最后两行加入extension_dir=/usr/local/src/services/php/lib/php/extensions/no-debug-zts-20131226 extension=上面那几个文件
 
 
 
 
 
./configure --prefix=/usr/local/src/services/php --with-config-file-path=/usr/local/src/services/php/etc --with-apxs2=/usr/local/src/services/apache2/bin/apxs --with-mysql=/usr/local/src/services/mysql --with-mysqli=/usr/local/src/services/mysql/bin/mysql_config --with-php-config=/usr/local/src/services/php/bin/php_config --enable-mbstring=LANG --enable-bcmath --enable-sockets --with-gd-dir=/usr/local/src/services/gd2 --with-libxml-dir=/usr/local/src/services/libxml2 --with-png-dir=/usr/local/src/services/libpng --with-jpeg-dir=/usr/local/src/services/jpeg9 --with-freetype-dir=/usr/local/src/services/freetype
 
 
 
以下这个是根据下面的重新引导:
 
./configure --prefix=/usr/local/src/services/php --with-config-file-path=/usr/local/src/services/php/etc --with-apxs2=/usr/local/src/services/apache2/bin/apxs --with-mysql=/usr/local/src/services/mysql --with-mysqli=/usr/local/src/services/mysql/bin/mysql_config --with-php-config=/usr/local/src/services/php/bin/php_config --enable-mbstring=LANG --enable-bcmath --enable-sockets --with-gd-dir=/usr/local/src/services/gd2 --with-zlib --with-curl=/usr/local/src/services/curl --with-zlib-dir=/usr/local/services/zlib --with-libxml-dir=/usr/local/src/services/libxml2 --with-png-dir=/usr/local/src/services/libpng --with-jpeg-dir=/usr/local/src/services/jpeg9 --with-freetype-dir=/usr/local/src/services/freetype --with-iconv-dir --with-fpm-user=www --with-fpm-group=www --with-pcre-regex  --enable-fpm --disable-phar --enable-calendar --enable-dba --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-mbstring --enable-pcntl --enable-xml --disable-rpath --enable-zip --disable-ipv6 --enable-ctype --enable-bcmath --enable-sockets --with-gettext
 
 
 
15.安装PHP  php-5.6.38.tar.gz
 
# cd /root
# tar -zxvf php-5.6.38.tar.gz
# cd php-5.6.38
# ./configure --prefix=/usr/local/services/php --with-config-file-path=/usr/local/services/php/etc --with-iconv-dir --with-fpm-user=www --with-fpm-group=www --with-pcre-regex --with-zlib --with-curl=/usr/local/services/curl --with-libxml-dir=/usr/local/services/libxml2 --with-zlib-dir=/usr/local/services/zlib --with-freetype-dir --with-mhash --with-mcrypt=/usr/local/services/libmcrypt --with-apxs2=/usr/local/services/apache2/bin/apxs --enable-fpm --disable-phar --enable-calendar --enable-dba --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-mbstring --enable-pcntl --enable-xml --disable-rpath --enable-zip --disable-ipv6 --enable-ctype --enable-bcmath --enable-sockets --with-gettext --with-ldap=/usr/local/services/openldap
说明:PHP有很多扩展需要安装
# https://segmentfault.com/q/1010000009247194/a-1020000009247318
# make install
成功安装后截图:
 
16. PHP配置
 
在当前目录下:
# cp php.ini-production /usr/local/services/php/etc/php.ini
# cd /usr/local/services/php/etc/
# cp php-fpm.conf.default php-fpm.conf
17. PHP启动,重启,关闭
 
PHP5.3以上自带的php-fpm的系统启动脚本时,它会自己建立一个php-fpm.pid的文件,但是php-fpm配置文件里默认是不会启用这个选项的,所以在使用以上脚本时,会无法关掉php-fpm的进程。
解决方案是,找到/usr/local/services/php/etc/php-fpm.conf,去掉下面两行代码前的";":
# vi /usr/local/services/php/etc/php-fpm.conf
pid = run/php-fpm.pid
error_log = log/php-fpm.log
如果系统本身没有php-fpm.pid这个文件,那么修改后,要重启系统(reboot)才会自动生成php-fpm.pid
 
a. 开启php-fpm
# /usr/local/services/php/sbin/php-fpm
b. 重启php-fpm
# kill -USR2 `cat /usr/local/services/php/var/run/php-fpm.pid`
c. 关闭php-fpm
# kill -INT `cat /usr/local/services/php/var/run/php-fpm.pid`
18.修改apache/php配置文件,并重启apache和php
 
a. 修改apache配置文件
# vi /usr/local/services/apache2/conf/httpd.conf
找到:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
添加如下内容
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php
 
b. 检查libphp5.so文件
检查LoadModule php5_module modules/libphp5.so 是否已经添加 libphp5.so文件是否存在
 
c. 编辑测试php文件
在/usr/local/services/apache2/htdocs目录下编辑1.php文件,内容如下:
<?php phpinfo(); ?>
通过浏览器打开http://172.27.34.152/1.php,打开页面如下即表示成功:
重启后查看还有--------!!!!!
 
2、拷贝库文件
 
cp -frp /usr/lib64/libldap* /usr/lib/ 
 
3、编译安装php-ldap模块
 
cd /usr/local/src/php-7.0.21/ext/ldap/  (源码包路径)
/usr/local/php/bin/phpize         (php安装路径)
./configure --with-php-config=/usr/local/src/php/bin/php-config  (php安装路径)
make
make install
 
https://blog.51cto.com/327101303/1618276
 
 
 
现在就是
 
PHP gd unknown 2.0 Fail
PHP gd PNG support off Fail
PHP gd JPEG support off Fail
PHP gd FreeType support off Fail
 
 
把这个解决就可以安装zabbix:
 
./configure --prefix=/usr/local/src/services/php --with-config-file-path=/usr/local/src/services/php/etc --with-apxs2=/usr/local/src/services/apache2/bin/apxs --with-mysql=/usr/local/src/services/mysql --with-mysqli=/usr/local/src/services/mysql/bin/mysql_config --with-php-config=/usr/local/src/services/php/bin/php_config --enable-mbstring=LANG --enable-bcmath --enable-sockets --with-gd --with-zlib --with-curl=/usr/local/src/services/curl --with-zlib --with-libxml-dir=/usr/local/src/services/libxml2 --with-png-dir --with-jpeg-dir --with-freetype=/usr/local/src/services/freetype --with-iconv-dir --with-fpm-user=www --with-fpm-group=www --with-pcre-regex  --enable-fpm --disable-phar --enable-calendar --enable-dba --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-pcntl --enable-xml --disable-rpath --enable-zip --disable-ipv6 --enable-ctype --with-gettext --enable-opcache --with-ldap
 
 
# xz -d node-v8.11.1-linux-x64.tar.xz
 
# tar -xvf node-v8.11.1-linux-x64.tar.xz
 

 

(责任编辑:IT)
------分隔线----------------------------