3、php安装
解压缩下载的php安装文件,这里以php-5.5.29.tar.gz为例
#tar zxvf php-5.5.29.tar.gz
#cd php-5.5.29
./configure –prefix=/usr/local/php5
–with-config-file-path=/uusr/local/php5/lib –with-mysql –with-libxml-dir
–enable-ftp –enable-sockets –with-gd –with-jpeg-dir –with-png-dir
–with-freetype-dir –with-zlib-dir –enable-gd-native-ttf
–enable-magic-quotes –with-iconv –enable-mbstring=all –disable-cgi
–with-openssl –with-mcrypt –enable-bcmath –enable-calendar –enable-exif
–enable-libxml –with-bz2 –with-curl –with-xmlrpc –with-gettext
–disable-cli –disable-debug –enable-zend-multibyte –with-mhash –enable-pcntl –enable-sysvsem –enable-inline-optimization –enable-soap –disable-ipv6 –enable-fpm
注意:如果你的mysql是rpm安装的话可以不指定路径,其他路径按照自己的要求设定
#make
#make install
#cp php.ini-development /usr/local/php5/lib/php.ini
#cd /usr/local/php5
#cd etc
#cp php-fpm.conf.default php-fpm.conf
#vim php-fpm.conf启用如下几行,即去掉前面的分号(;) pid = run/php-fpm.pid error_log = log/php-fpm.log log_level = notice listen = 127.0.0.1:9000 listen.allowed_clients = 127.0.0.1 pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 500 env[HOSTNAME] = $HOSTNAME env[PATH] = /usr/local/bin:/usr/bin:/bin env[TMP] = /tmp env[TMPDIR] = /tmp env[TEMP] = /tmpwq保存退出
#/usr/local/php5/sbin/php-fpm# netstat -antpl (如果看到9000端口,PHP-FPM配置成功)