源码编译安装php-5.3.8(含php-fpm):
环境:Centos 6.5
[root@localhost php-5.3.8]# ./configure --prefix=/usr/local/php --enable-mbstring --enable-soap --enable-wddx=shared --enable-xml --with-gd --with-gettext --with-regex=system --with-zlib-dir=/usr/local/zlib --enable-fpm --with-jpeg-dir --with-fpm-user=www --with-fpm-group=www --enable-shmop --with-mcrypt --with-mysqli=mysqlnd
[root@localhost php-5.3.8]# make &&make install
错误1:
64位centos上编译的时候报错:configure: error: mysql configure failed. Please check config.log
解决方法:
找到/usr/lib64/libltdl.so.3.1.4,在该目录下执行以下命令:
ln -sv libltdl.so.3.1.4 libltdl.so 最终将出现如下内容,
+--------------------------------------------------------------------+
| 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.
错误2: 启动错误解决:
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)
[root@localhost ~]# ps -ef|grep php|grep -v grep
root 1592 1 0 12:36 ? 00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
www 1593 1592 0 12:36 ? 00:00:00 php-fpm: pool www
www 1594 1592 0 12:36 ? 00:00:00 php-fpm: pool www