Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install php in zabbix

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how zabbix installs php. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. You can install php through the official website (wget http://www.php.net/get/php-5.5.0.tar.bz2/from/jp1.php.net/mirror).

2. Install related dependency packages and make sure that lib development libraries such as gd,png,curl,xml can be installed using yum before installation.

[root@localhost conf] # yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel-y

3, compile and install PHP 5.5

[root@localhost install] # tar-xvf php-5.5.28.tar.bz2 [root@localhost install] # cd php-5.5.28 [root@localhost install]. / configure-- prefix=/usr/local/php\-- with-config-file-path=/usr/local/php/etc-- with-bz2-- with-curl\-- enable-ftp-- enable-sockets-- disable-ipv6-- with-gd\-- with-jpeg -dir=/usr/local-- with-png-dir=/usr/local\-- with-freetype-dir=/usr/local-- enable-gd-native-ttf\-- with-iconv-dir=/usr/local-- enable-mbstring-- enable-calendar\-- with-gettext-- with-libxml-dir=/usr/local-- with-zlib\-- with-pdo-mysql=mysqlnd-with-mysqli=mysqlnd-- with-mysql=mysqlnd\-- enable-dom -enable-xml-- enable-fpm-- with-libdir=lib64-- enable-bcmath [root@localhost install] # make [root@localhost install] # make install

4, configure php

[root@GJB-Monitor php-5.6.24] # cp php.ini-production / usr/local/php/etc/php.ini [root@GJB-Monitor php-5.6.24] # rm-rf / etc/php.ini [root@GJB-Monitor php-5.6.24] # ln-s / usr/local/php/etc/php.ini / etc/php.ini [root@localhost install] cd / usr/locat/php/etc/ [root@localhost etc] # cp php- Fpm.conf.default php-fpm.conf [root@GJB-Monitor php-5.6.24] # cp / usr/local/php/etc/php-fpm.conf.default / usr/local/php/etc/php-fpm.conf [root@GJB-Monitor php-5.6.24] # vim / usr/local/php/etc/php-fpm.confpid = run/php-fpm.pid # cancel the semicolon before it

5. Provide startup script for php (make service startup)

[root@localhost php] # cp sapi/fpm/init.d.php-fpm / etc/rc.d/init.d/php-fpm

[root@localhost php] # chmod + x / etc/rc.d/init.d/php-fpm

[root@localhost php] # chkconfig-- add php-fpm

[root@localhost php] # chkconfig php-fpm on

6. Start the php service:

[root@localhost php] # service php-fpm start

5 to see if the service is started:

[root@localhost sbin] # netstat-lnt | grep 9000tcp 00 127.0.0.1lnt 9000 0.0.0.0 LISTEN

(2) method 2 install through yum

Yum list installed | grep php

Delete the existing php version first, and delete the php by executing the following command

Yum remove php-common

Then ask you if you want to continue as installed, just type yes.

1. Add a yum source

Source of CentOS 6.x # rpm-Uvh # rpm-Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpmCentOS 7.x Source # rpm-Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm # rpm-Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

2. Install PHP

# yum install-- enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common Note: install version 5.6 as remi-php56, install version 5.5 as remi-php55

3. View the PHP version

# php-vPHP 5.6.18 (cli) (built: Feb 3 2016 10:25:33) Copyright (c) 1997-2016 The PHP Group Thank you for reading! This is the end of this article on "how to install php in zabbix". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report