####### 安装 ####### 模块安装和以往的安装方式一样,并且版本可以不变,模块的库也可以和老版的php共享, 重点在于PHP5.3.3及以上版本已经集成php-fpm了,不再是第三方的包了, 在./configure的时候带-enable-fpm参数即可开启PHP-FPM,其它都差不多。 ####安装支持库#### yum install curl-devel cd /root/software tar zxf php-5.6.30.tar.gz cd php-5.6.30 和nginx整合#####新方法安装PHP-5.6#####增加--with-xpm-dir=/usr/lib64 ./configure --prefix=/opt/php \ --with-config-file-path=/opt/php/etc \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-gd=/opt/modules/gd \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --with-xpm-dir=/usr/lib64 \ --with-iconv-dir=/opt/modules/libiconv \ --with-jpeg-dir=/opt/modules/jpeg \ --with-zlib-dir=/opt/modules/zlib \ --with-png-dir=/opt/modules/libpng \ --with-freetype-dir=/opt/modules/freetype \ --enable-mbstring \ --with-libxml-dir=/opt/modules/libxml \ --with-curl \ --enable-zip \ --enable-soap \ --enable-ftp \ --enable-sockets \ --enable-embedded-mysqli \ --with-mcrypt=/opt/modules/libmcrypt \ --with-mhash=/opt/modules/mhash \ --with-mysql=/opt/mysql \ --with-mysqli=/opt/mysql/bin/mysql_config \ --with-mysql-sock=/opt/mysql/tmp/mysql.sock \ --with-pdo-mysql=/opt/mysql \ --enable-bcmath \ --with-gettext 说明: opessl可能需要用系统RPM安装的: yum install opessl openssl-devel 遇错configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/ 解决: yum install curl-devel 如果和apache整合,而服务器已经有一个和nginx整合的/opt/php了,那么可以编译到新目录,如: ./configure --prefix=/opt/php_apache \ --with-apxs2=/opt/apache2/bin/apxs \ --with-gd=/opt/modules/gd \ --with-jpeg-dir=/opt/modules/jpeg7 \ --with-zlib-dir=/opt/modules/zlib_apache \ --with-png-dir=/opt/modules/libpng \ --with-freetype-dir=/opt/modules/freetype \ --with-mysql=/opt/mysql \ --enable-mbstring=all \ --with-curl \ --enable-mbregex \ --with-config-file-path=/opt/php_apache/etc \ --enable-ftp \ --enable-soap \ --with-xsl \ --with-libxml-dir=/opt/modules/libxml 编译和安装: make make install 拷贝配置: cp /root/software/php-5.6.30/php.ini-production /opt/php/etc/php.ini cp /opt/php/etc/php-fpm.conf.default /opt/php/etc/php-fpm.conf 配置成服务: vi /opt/php/etc/php-fpm.conf 掉掉pid目录的注释,顺便把error_log的也去了: ;pid = run/php-fpm.pid ;error_log = log/php-fpm.log cp -f /root/software/php-5.6.30/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 有的在sapi/fpm/conf/init.d.php-fpm chmod 755 /etc/init.d/php-fpm /sbin/chkconfig --add php-fpm /sbin/chkconfig --level 345 php-fpm on 启动服务: service php-fpm start