1.8LNMP environment compilation installation php-5.6.14
I. decompress php
[Root @ www src] # tar jxf php-5.6.14.tar.bz2
[Root @ www src] # cd php-5.6.14
2. create PHP users
[Root @ www php-5.6.14] # useradd-s/sbin/nologin php-fpm
3. Compile and install php
[Root @ www php-5.6.14] #./configure \
> -- Prefix =/usr/local/php \
> -- With-config-file-path =/usr/local/php/etc \
> -- Enable-fpm \
> -- With-fpm-user = php-fpm \
> -- With-fpm-group = php-fpm \
> -- With-mysql =/usr/local/mysql \
> -- With-mysql-sock =/var/lib/mysql. sock \
> -- With-mysqli =/usr/local/mysql/bin/mysql_config \
> -- With-freetype-dir =/usr/local/freetype \
> -- With-jpeg-dir =/usr/local/defaults 6 \
> -- With-mcrypt =/usr/local/libmcrypt \
> -- With-gd =/usr/local/libgd2 \
> -- With-iconv-dir =/usr/local/libiconv \
> -- With-png-dir \
> -- With-zlib \
> -- With-libxml-dir \
> -- With-curl \
> -- With-mhash \
> -- With-openssl \
> -- With-pear \
> -- Enable-soap \
> -- Enable-gd-native-ttf \
> -- Enable-ftp \
> -- Enable-mbstring \
> -- Enable-exif \
> -- Enable-zend-multibyte \
-- Disable-ipv6 \
> -- Enable-bcmath \
> -- Enable-shmop \
> -- Enable-sysvsem \
> -- With-pcre-dir
Configure: WARNING: unrecognized options: -- enable-zend-multibyte (Unsupported parameter)
[Root @ www php-5.6.14] # make & make install
[Root @ www php-5.6.14] # ls/usr/local/php/
Bin etc include lib php sbin var
1. copy the main configuration file of php
[Root @ www php-5.6.14] # cp php. ini-production/usr/local/php/etc/php. ini
2. copy the startup script
[Root @ www php-5.6.14] # cp sapi/fpm/init. d. php-fpm/etc/init. d/php-fpm
[Root @ www php-5.6.14] # chmod 755/etc/init. d/php-fpm
[Root @ www php-5.6.14] # chkconfig -- add php-fpm
[Root @ www php-5.6.14] # chkconfig php-fpm on
3. copy the php-fpm configuration file.
[Root @ www php-5.6.14] # mv/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
[Root @ www php-5.6.14] # ls/usr/local/php/etc/
The pear. conf php-fpm.conf php. ini
4. check configuration errors
[Root @ www php-5.6.14] #/usr/local/php/sbin/php-fpm-t
[16-Dec-2015 14:16:26] NOTICE: configuration file/usr/local/php/etc/php-fpm.conf test is successful
5. start php-fpm
[Root @ www php-5.6.14] # service php-fpm start
Starting php-fpm done
6. View processes
[Root @ www php-5.6.14] # ps aux | grep php-fpm
Root 16922 0.0 0.4 129188 4988? Ss php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
Php-fpm 16923 0.0 0.4 129188 4636? S php-fpm: pool www
Php-fpm 16924 0.0 0.4 129188 4636? S php-fpm: pool www
Root 16927 0.0 0.0 103248 876 pts/0 S + grep php-fpm
7. view the listening port
[Root @ www php-5.6.14] # netstat-nltp | grep php-fpm
Tcp 0 0 127.0.0.1:90000.0.0.0: * LISTEN 16922/php-fpm