chmod: cannot access `/usr/local/apache2/modules/libphp5.so': No such file

在尝试安装PHP的apache2handler SAPI模块时,遇到`chmod: cannot access '/usr/local/apache2/modules/libphp5.so': No such file`错误。问题可能由libtool版本不一致或未安装libtool导致。解决方案包括:确保Apache和PHP使用的libtool版本相同,使用`cp`命令同步libtool,或通过`apt-get install libtool`安装libtool。重新运行`./configure`和`make install`,确保使用正确的`--with-apxs2`选项,并在重新配置前清理源代码目录。

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

Installing PHP SAPI module: apache2handler

/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apr/build-1/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apr/build-1/libtool --mode=install install libphp5.la /usr/local/apache2/modules/
libtool: install: install .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: install .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
libtool: install: chmod 644 /usr/local/apache2/modules/libphp5.a
libtool: install: ranlib /usr/local/apache2/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish /home/ligl/src/php5/libs'
Warning! dlname not found in /usr/local/apache2/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: cannot access `/usr/local/apache2/modules/libphp5.so': No such file or directory
apxs:Error: Command failed with rc=65536

 

1.是由于libtool版本不一致造成的。
把apache 目录build下面的libtool拷贝到了php编译安装的目录下,make clean 再重新configure ,make  ,make install,就行了。
比如我的apache安装在/usr/local/apache/ ,php-5.3.6为下载的php解压目录
cp /usr/local/apache/build/libtool php-5.3.6/

Java代码   收藏代码
  1. Both Apache2 and PHP have and is using the correct version:  
  2.   
  3. # pwd  
  4. /usr/local/src/php5-200404070830  
  5. # ./libtool --version  
  6. ltmain.sh (GNU libtool) 1.4.3 (1.922.2.110 2002/10/23 01:39:54)  
  7.   
  8. # /usr/local/apache2/build/libtool --version  
  9. ltmain.sh (GNU libtool) 1.4.3 (1.922.2.110 2002/10/23 01:39:54)   

sudo cp /usr/bin/libtool /usr/local/apache2/build/

 

find / -name libphp5.so

First make sure libphp5.so isn't there. It's usually in the libs or .libs subdirectory. Run find from the PHP source directory root: find . -name libphp5.so If that doesn't work, make sure you use the --with-apxs2 option with the correct directory in ./configure . For example: 
./configure --with-MySQL --with-apxs2=/path/to/apache/apxs 
When re-running ./configure always start with a fresh, clean source directory (no object).

 

2.原因是没有安装 libtool

# apt-get install libtool

无法生成so文件

你./configure --help看看 
apache2.0.48是用的 --enable-so 这样的参数呀

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值