源码编译安装PHP报错,源码编译安装php-3.5.8

本文档记录了在64位CentOS 6.5环境下编译安装PHP 5.3.8及其FPM扩展时遇到的两个主要问题及解决方案。首先,在配置阶段出现mysqlconfigure失败的问题,通过创建软链接解决。其次,启动PHP-FPM时,由于配置文件中pm.min_spare_servers和pm.max_spare_servers的值设置为0导致错误,调整这两个参数并重启服务后成功运行。
摘要由CSDN通过智能技术生成

源码编译安装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_serversALERT: [pool www] pm.max_spare_servers(0) must be a positive value编辑php-fpm.conf找到pm.max_spare_servers 去除;号,同样非注释内容pm.max_spare_serversWARNING: [pool www] pm.start_servers is not set. It's been set to 20.编辑php-fpm.conf找到pm.start_servers 去除;号,同样非注释内容pm.start_serversERROR: 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

···

[root@localhost ~]#

[root@localhost sbin]# pkill php-fpm

[root@localhost sbin]# /usr/local/php/sbin/php-fpm

这样就执行成功了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值