下载php
cd /usr/local/src/ wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
解压源码包
tar zxf php-5.6.30.tar.gz
创建用户
useradd -s /sbin/nologin php-fpm
配置编译参数
cd php-5.6.30 ./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-mysqli=/usr/local/mysql/bin/mysql_config ?--with-pdo-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 ?--with-pear ?--with-curl ??--with-openssl
编译安装php
make && make install
拷贝配置文件
cp php.ini-production /usr/local/php-fpm/etc/php.ini
vi /usr/local/php/etc/php-fpm.conf //写入如下内容(参考
拷贝启动脚本
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
启动Php
service php-fpm start
查看进程
ps aux |grep php-fpm
LNMP环境搭建之php安装
原文地址:http://blog.51cto.com/chenshengsheng/2103644