php 5.3 以上fpm安裝

安裝PHP
#wget http://cn2.php.net/get/php-5.3.8.tar.gz/from/cn.php.net/mirror
#tar -zxvf php-5.3.8.tar.gz
#cd php-5.3.8
#./configure --prefix=/usr/local/php --enable-fpm --with-libevent-dir=/usr --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --with-bz2 --with-gettext --with-snmp --enable-zip --with-snmp

出現以下內容,
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.

安裝
#make
#make install
移動php.ini
#cp /usr/local/php-5.3.8/php.ini-development /usr/local/php/lib/php.ini

關於php-fpm
php5.3.8默認包含php-fpm,

php-fpm的配置文件php-fpm.conf在/usr/local/php/etc <========固然要看你裝php到了那裏
php-fpm.conf的文件名這裏爲php-fpm.conf.default
#cp php-fpm.conf.default php-fpm.conf <========複製一份並重命名

php-fpm在/usr/local/php/sbin/下
#/usr/local/php/sbin/php-fpm ========啓動php-fpm
啓動錯誤解決:
ALERT: [pool www] pm.min_spare_servers(0) must be a positive value
編輯php-fpm.conf找到pm.min_spare_servers 去除;號,注意非註釋內容pm.min_spare_servers
ALERT: [pool www] pm.max_spare_servers(0) must be a positive value
編輯php-fpm.conf找到pm.max_spare_servers 去除;號,一樣非註釋內容pm.max_spare_servers
WARNING: [pool www] pm.start_servers is not set. It's been set to 20.
編輯php-fpm.conf找到pm.start_servers 去除;號,一樣非註釋內容pm.start_servers
ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
# netstat -ntlp|ps -ef|grep php查看進程,有N多進程
nobody 26152 26151 0 15:45 ? 00:00:00 php-fpm: pool www
nobody 26153 26151 0 15:45 ? 00:00:00 php-fpm: pool www
nobody 26154 26151 0 15:45 ? 00:00:00 php-fpm: pool www
nobody 26155 26151 0 15:45 ? 00:00:00 php-fpm: pool www
...........................
#killall php-fpm 結束全部php-fpm進程
再啓動php-fpm
#/usr/local/php/sbin/php-fpm
成功php

 

若是還沒法啓動 查看9000端口是否佔用mysql

netstat -tunlp |grep 9000nginx

若是佔用sql

修改php-fpm.conf文件裏面的listen 端口地址curl

成功socket

再次修改nginx裏面php fast_cgi端口配置php-fpm

重啓nginxui

成功this

 

注意啓動命令多是./php-fpmurl

相關文章
相關標籤/搜索