Zabbix學習筆記(三)

1、環境介紹

操作系統:Centos7.3 Linux

版本:PHP5.6.34

鏡像源:阿里鏡像源

2、安裝依賴包

yum -y install  gcc gcc-c++ make pcre pcre-devel zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel openldap openldap-devel libmcrypt libmcrypt-devel

3、編譯安裝

tar zxf php-5.6.34.tar.gz

cd php-5.6.34

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-ctype --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-fpm 

make

make install

 

cp php.ini-production /usr/local/php/etc/php.ini

4、使用systemctl管理php-fpm

目錄創建:

mkdir p /usr/lib/system/system/

/usr/lib/system/system/php-fpm.service

[Unit]

Description=php-fpm

After=network.target#網絡啓動以後啓動

[Service]

Type=forking

ExecStart=/usr/local/php/sbin/php-fpm

[Install]

WantedBy=multi-user.target

5、啓動

環境變量:

export PATH=$PATH:/usr/local/php/sbin/:/usr/local/bin/

生成配置文件:

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

啓動:

    php-fpm t檢查

systemctl start php-fpm或者php-fpm 

netstat -lntup|grep php

image.png 

6、文件目錄

目錄/usr/local/php/

lib var sbin php include bin etc



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章