Zabbix installation and Deployment---problem handling (php65.6.28 mysqli report error handling)

Source: Internet
Author: User
Tags fpm gettext install php php source code snmp

1) php65.6.28 mysqli report error handling http://www.xiaochengfu.com/index.php/index/detail/aid/92. HTML2) PHP add mysqli extension mysqli_api.lo error under Linux

Http://jingyan.baidu.com/article/a3f121e4cb684afc9152bb73.html

First, pre-preparation
    • Installation and configuration of MySQL
      See my previous blog for specific steps: (ii) MySQL installation and configuration
    • In order to configure the Zabbix front-end, I need nginx and PHP support, specific steps to see: Nginx Installation and configuration and how to support PHP. However, because the installation configuration Zabbix front-end, so the installation of PHP needs to include specific options, so the specific installation of PHP will be at the end of the article according to the troubleshooting process.
    • Dependent package installation

      # yum-y install net-snmp net-snmp-devel perl-dbi php-gd php-xml Php-bcmath fping Openipmi-devel php-mbstring     
      two. Install Zabbix
    • 1. The zabbix-3.0.4/database in the source code The SQL file under/mysql is imported into the Zabbix database (must be entered in the following order)

default character set utf8;# tar -xvzf zabbix-3.0.4.tar.gz# cd zabbix-3.0.4# /usr/local/mysql/bin/mysql -u root -h localhost zabbix < schema.sql# /usr/local/mysql/bin/mysql -u root -h localhost zabbix < images.sql# /usr/local/mysql/bin/mysql -u root -h localhost zabbix < data.sql
    • 2. Create users and Groups
# groupadd zabbix# useradd -g zabbix zabbix
    • 3. Install the Zabbix server (the server itself must also be monitored, so install the agent at the same time)
# ./configure --prefix=/usr/local/zabbix/ --enable-server  --enable-agent --with-mysql --with-net-snmp
for net-snmp-config... noconfigure: error: Invalid Net-SNMP directory - unable to find net-snmp-config解决方案:# yum install net-snmp-devel -y
    • 4. Modify the configuration file

listenport=10051
Logfile=/tmp/zabbix_server.log
Dbhost=localhost
Dbname=zabbix
Dbuser=root #我直接用root用户作为zabbix数据库的用户 with no password set
listenip=127.0.0.1

    • 5. Start Zabbix
# /usr/local/zabbix/sbin/zabbix_server启动时报错:Starting zabbix_server:  /usr/local/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory解决方案:# locate libmysqlclient.so.18# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf# ldconfig
Third, configure the Web interface support

For web interface support, Nginx (requires PHP-FPM) and PHP support are required, see the routing connection at the beginning of the article for installation methods. After the installation of Nginx and PHP, do the following.

    • 1. Copy all the files in the zabbix-3.0.4/frontends/php into the Zabbix in the root directory of the Web service, where I use Nginx as the Web server.
# cd zabbix-3.0.4/frontends/php# mkdir /usr/local/nginx/html/zabbix/# cp -a . /usr/local/nginx/html/zabbix/启动nginx和php-fpm# /usr/local/nginx/sbin/nginx# /usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini

When installing PHP, be sure to see the Zabbix Official document on the Requirements, otherwise in the compilation and installation of PHP will miss a lot of support component information, resulting in a smooth web interface configuration Zabbix front-end.

Here are the pits I've stepped on:

    • Error 1
"post_max_size"    8M    16M    Fail 等需要更改php.ini文件,但是在安装PHP时需要指定php的配置文件的存放位置,如我的指定为: --with-config-file-path=/usr/local/php/etc 然后将源码里面的php.ini-production 拷贝到/usr/local/php/etc/php.ini注意:在编译安装完成php后,配置完成启动php-fpm时,直接执行/usr/local/php/sbin/php-fpm 虽然可以启动,但是这样的话,php.ini文件是没有生效的,这就会导致即使你更改了php.ini里面的参数,Zabbix前端检测依然无法通过。解决方法是按照以下方式启动php-fpm:# /usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini
    • Error 2
PHP bcmath    off        Fail                --enable-bcmath    PHP mbstring    off        Fail            --enable-mbstringPHP sockets    off        Fail                --enable-sockets等这些错误只要在安装PHP时加上对应选项即可,如:--enable-bcmath
    • Error 3
PHP databases support off Fail--with-mysql=/usr/local/mysql Solution: This error is prompt does not support MySQL, but we were specified when compiling the installation, why error? Because the updated PHP version, now requires MYSQLI support to line, mysqli is the MySQL function (note here refers to the function in PHP) optimization, so we need to install into the PHP source code in the Mysqli directory can be installed, the method is as follows: # CD php-5.6.25/ext/mysqli/# phpize#./configure--with-php-config=/usr/local/php/bin/php-config--with-mysqli=/usr/local/mysql/bin/mysql_config# make && Makeinstall# cd/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226# ls If there is a mysqli.so file, say the name is installed. Then edit the PHP config file/usr/local/php/etc/php.ini, add extension=mysqli.so (can write full path) when make && do install:/root /soft/php-5.6. 25/ext/mysqli/mysqli_api.  C: £ º:error:ext/mysqlnd/mysql_float_to_double.h:  No such file or directorymake: * * * [Mysqli_api.lo] Error 1 Workaround: Edit Mysqli_api.  C, then comment out mysql_float_to_double.h this header file (honestly, I don't know what the consequences will be)          
    • Series Error 4
PHP GD JPEG support off Fail--with-jpeg-dir=dir Gd:set The path to libjpeg install prefix solution: compiling and installing jpeg# wget http://www.ijg.org/files/jpegsrc . v9b.tar.gz# mkdir/usr/local/jpeg#./configure--prefix=/usr/local/jpeg--enable-sharedphp GD PNG support off Fail--with-png-dir=dir Gd:set The path to libpng install prefix solution: compiling and installing libpng# wget http://prdownloads.sourceforge.net/ libpng/libpng-1.6.24.tar.gz?download# mkdir/usr/local/libpng#./configure--prefix=/usr/local/libpng to compile the GD library, you need libpng and Libjpeg (previously installed) PHP GD Unknown 2.0 Fail--with-gd=dir Include GD support. DIR is the GD library Base install directory bundled solution: Enter the PHP source ext/gd directory to compile and install the GD libraries # YumInstall gd-devel# CD php-5.6.8/ ext/gd# phpize#./configure--with-jpeg-dir=/usr/local/jpeg--with-php-config=/usr/local/php/bin/php-config Tip: Configure:Error:png.hNotFound. FIX: # yumInstall Libpng-devel # make clean # makeInstall when I compile PHP to perform the source installation of GD (/usr/LOCAL/GD) directory, compilation cannot be passed. Directly add--WITH-GD (I suspect I installed gd-devel with yum) PHP GD FreeType SupportOff Fail--with-freetype-dir=dir Gd:set the path to freetype 2 install prefix solution: Compile and install FreeType # wget Https://sourceforge.net/proj ects/freetype/files/freetype2/2.6. 5/freetype-2.6. 5.tar.gz/download# mkdir/usr/ local/freetype#/configure--prefix=/usr /local/freetype/# make && make installphp gettext off Warning --with-gettext=dir Include GNU Gett Ext Support Solution: # wget/ http/ftp.gnu.org/pub/gnu/gettext/gettext-0.19.tar.gz# mkdir/usr/Local /gettext#./configure --prefix=/usr/local/gettext          

So in order to support the Zabbix frontend, the following options are required to compile and install PHP:

--prefix=/usr/local/php --with-mysql=/usr/local/mysql --enable-fastcgi --enable-fpm --with-config-file-path=/usr/local/php/etc -with-zlib=/usr/local/zlib --enable-bcmath \ --enable-mbstring --enable-sockets --with-gettext=/usr/local/gettext --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/include/freetype2/freetype --with-gd

Attention:



Text/Simple Superman (Jane book author)
Original link: http://www.jianshu.com/p/68016c9006f4
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

Zabbix installation and Deployment---problem handling (php65.6.28 mysqli report error handling)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.