有关编译安装php和php-fpm时出现的问题

在尝试编译安装PHP及其fpm扩展时遇到了问题。错误信息表明在构建过程中可能出现了对象删除或Makefile配置相关的问题。解决这个问题需要对编译过程和依赖项有深入理解。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


首先安装的是php5.16版本的,需要另外安装php-fpm,结果安装半天还是有问题。改安装php5.3版本,因为自带了fpm模块,直接编译上去就行了。
编译php,
./configure 
    --with-iconv-dir=/usr/local/\
    --with-freetype-dir\
    --with-jpeg-dir\
    --with-png-dir\
    --with-zlib\
    --with-mhash\
    --enable-sockets\
    --enable-ftp\
    --with-libxml-dir\
    --enable-xml\
    --disable-rpath\
    --enable-safe-mode\
    --enable-bcmath\
    --enable-shmop\
    --enable-sysvsem\
    --enable-inline-optimization\
    --with-curl\
    --with-curlwrappers\
    --enable-mbregex\
    --enable-mbstring\
    --with-mcrypt\
    --with-gd\
    --enable-gd-native-ttf\
    --with-openssl\
    --with-mhash\
    --enable-pcntl\
    --enable-sockets\
    --with-ldap\
    --with-ldap-sasl\
    --enable-fpm\
    --with-xmlrpc\
    --enable-zip\
    --enable-soap\
    --without-pear
结果make的时候就会出现如下错误:
libtool: link: `sapi/fpm/fpm/fpm_children.lo' is not a valid libtool object


查找了一下,说是libtool版本太低,自己查了一下自己版本,是2005年的版本,于是安装了一个2010年的版本,重新编译,make的时候,还是出现原来错误!


有人说是使用make realclean命令,结果尝试了一下
make * realclean /安装包的目录
结果没有什么作用

从网上找来了这段命令的介绍, http://www.ccp4.ac.uk/peter/programming/makefile-targets.html
Makefile Targets

Below are some empirical definitions of what each of the "standard" Makefile targets (clean, realclean, distclean and uninstall) should do:

    make clean - removes core, *.o, *~, a.out, *.orig, *.rej plus any other files created by the building of the program(s) (except of course the executable(s))
    make realclean - does make clean plus it removes the executables from the build directory
    make distclean - does make realclean plus removes Makefile, config.* files, C source files produced by configure and so on. Basically, after distclean only the originally distributed files should be left behind
    make uninstall - delete all installed files created by the install target. That's all, and doesn't depend on any of the other targets, so not actually as serious as it sounds.

So in principle the complete clean-up-for-starting-over prescription is (in top CCP4 directory) to do:

> make uninstall
> make distclean






最后尝试了一下 make distclean
没有报错,接着重新编译,make,竟然过去了,然后make install
完成后 ,检查了一下 pfm的安装状态
/usr/local/sbin/php-fpm -t

结果出现如图错误:

于是cp /var/php-5.3.13/sapi/fpm/php-fpm.conf  /usr/local/etc/
再测时,已经可以运行了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值