首页 > 代码库 > 2安装php+php-fpm

2安装php+php-fpm

配置php-fpm

php官网:http://www.php.net/

php-fpm                                        #要启动php-fpm服务,有端口,端口号9000

lampphp不用启动,它的工具是apxs,而lnmp中的php-fpm用的工具是enable-fpm

pnp-fpmnginx单独跑一个服务

 

 

步骤:

cd /usr/local/src/

wgethttp://cn2.php.net/distributions/php-5.6.19.tar.gz

tar zxvf php-5.6.19.tar.gz

cd php-5.6.19

#因为编译的时候需要很多相关的包,都是with进去的,所以先下载好

yum install -y gcc

yum install -y libxml2-devel

yum install -y curl-devel

yum install -y libjpeg-devel

yum install -y libpng libpng-devel

yum install -y freetype freetype-devel

#下面是汇总

yum install -y libxml2-devel curl-devellibjpeg-devel libpng libpng-devel freetype freetype-devel

wget http://www.lishiming.net/data/attachment/forum/epel-release-6-8_32.noarch.rpm

rpm -ivh epel-release-6-8_32.noarch.rpm

yum install -y  libmcrypt-devel

 

./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=/tmp/mysql.sock --with-libxml-dir  --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir  --with-iconv-dir   --with-zlib-dir   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-ftp --enable-mbstring  --enable-exif    --disable-ipv6     --with-curl

make && make install                        #make的时间比较长

 

useradd -s /sbin/nologin php-fpm                                                  #编译指定的用户和组

cp php.ini-production/usr/local/php/etc/php.ini                       #拷贝php.ini配置文件

mv /usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf     #php-fpm配置文件,启动脚本的变量

cp sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm

chmod 755 /etc/init.d/php-fpm

chkconfig --add php-fpm

chkconfig php-fpm on

/etc/init.d/php-fpm start

 

 

 

 

 

 

 

 

 

 

 

 

 


本文出自 “11736718” 博客,请务必保留此出处http://11746718.blog.51cto.com/11736718/1876247

2安装php+php-fpm