php安装 出现Sorry, I cannot run apxs. ***错误解决方法
2015-04-28 12:25
701 查看
# tar zvxf php-5.1.2.tar.gz
# cd php-5.1.2
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/include/libxml2/libxml --with-gd --with-zlib
# make
# make install
#
*** 注: 在configure过程中, 可能会遇到下面的错误! Sorry, I cannot run apxs. ***
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
configure: error: Sorry, I cannot run apxs. Either you need to install Perl or you need to pass the absolute path of apxs by using --with-apxs=/absolute/path/to/apxs
网上有很多介绍解决方法的, 但最经典的只有Darrell Brogdon在2001/03/15写的<<Installing PHP as an Apache DSO>>, 这篇文章在绿盟有徐永久在2002-03-18翻译的中文版<<在Apache上以DSO方式安装PHP>>, 不过上面著名他本人就是文章的作者, 这点我表示怀疑.
我之所以说这么多, 只是想说明目前我看到的方法, 没有能够真正解决这个问题的.
OK, 下面我说明一下我是如何解决这个问题的:
首先, 通过错误提示, 我们得知"I cannot run apxs". 我一直以为是apxs安装有问题, 但找了很久仍未得到合理的解释和解决方法.
于是我直接运行"/usr/local/apache/bin/apxs"这个脚本, 得到下面的错误提示:
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
哦, 给人的感觉很像仍然是apxs程序有问题, 但问题在哪里呢? "interpreter"是什么呢? interpreter是"解释程序"!
嗯, 看来我们接近答案了, 运行"head -1 /usr/local/apache/bin/apxs"得到下面内容:
#!/replace/with/path/to/perl/interpreter -w
天啊, 这里没有指明正确的perl执行程序的位置! 原来这就才是真正的问题原因所在!!!
把这一行更改为"#!/usr/bin/perl -w". 再运行php的configure, 一切正常!
至此, 问题已解决.
*** Sorry, I cannot run apxs. ***
原文链接:http://www.j3j5.com/post-285.html
# cd php-5.1.2
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/include/libxml2/libxml --with-gd --with-zlib
# make
# make install
#
*** 注: 在configure过程中, 可能会遇到下面的错误! Sorry, I cannot run apxs. ***
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
configure: error: Sorry, I cannot run apxs. Either you need to install Perl or you need to pass the absolute path of apxs by using --with-apxs=/absolute/path/to/apxs
网上有很多介绍解决方法的, 但最经典的只有Darrell Brogdon在2001/03/15写的<<Installing PHP as an Apache DSO>>, 这篇文章在绿盟有徐永久在2002-03-18翻译的中文版<<在Apache上以DSO方式安装PHP>>, 不过上面著名他本人就是文章的作者, 这点我表示怀疑.
我之所以说这么多, 只是想说明目前我看到的方法, 没有能够真正解决这个问题的.
OK, 下面我说明一下我是如何解决这个问题的:
首先, 通过错误提示, 我们得知"I cannot run apxs". 我一直以为是apxs安装有问题, 但找了很久仍未得到合理的解释和解决方法.
于是我直接运行"/usr/local/apache/bin/apxs"这个脚本, 得到下面的错误提示:
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
哦, 给人的感觉很像仍然是apxs程序有问题, 但问题在哪里呢? "interpreter"是什么呢? interpreter是"解释程序"!
嗯, 看来我们接近答案了, 运行"head -1 /usr/local/apache/bin/apxs"得到下面内容:
#!/replace/with/path/to/perl/interpreter -w
天啊, 这里没有指明正确的perl执行程序的位置! 原来这就才是真正的问题原因所在!!!
把这一行更改为"#!/usr/bin/perl -w". 再运行php的configure, 一切正常!
至此, 问题已解决.
*** Sorry, I cannot run apxs. ***
原文链接:http://www.j3j5.com/post-285.html
相关文章推荐
- 【linux】php安装 出现Sorry, I cannot run apxs. ***错误解决方法
- php安装 出现Sorry, I cannot run apxs. ***错误解决方法
- php安装 出现Sorry, I cannot run apxs. ***错误解决方法
- brew安装php70出现configure: error: Cannot find libz 错误解决方法
- 源码安装php时出现Sorry, I cannot run apxs. Possible reasons follow:
- 为PHP安装imagick时出现Cannot locate header file MagickWand.h错误的解决方法
- 为PHP安装imagick时出现Cannot locate header file MagickWand.h错误的解决方法
- 用apxs 安装apache mod_proxy时候出现undefined symbol: ap_proxy_lb_workers错误的解决方法
- 安装php常出现错误解决方法积累
- 用apxs 安装apache mod_proxy时候出现undefined symbol: ap_proxy_lb_workers错误的解决方法
- 已解决:好用的集成PHP环境 一键安装包PHPNow--Win7下安装phpnow的方法出现[ Apache_pn ] 错误的解决 !(亲自测试通过)
- 已解决:好用的集成PHP环境 一键安装包PHPNow--Win7下安装phpnow的方法出现[ Apache_pn ] 错误的解决 !(亲自测试通过)
- PHP 5.3.10 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- PHP 5.3.10 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- phpize 编译安装php扩展的时候出现Cannot find autoconf的解决方法
- PHP 编译安装时出现 undefined reference to `libiconv' 错误的解决方法
- windows安装mysql8.0.0解压版附出现1067错误解决方法
- 使用MDK5进行DEBUG时出现“cannot access target shutting down debug session”错误的解决方法
- 安装CocoaPods出现错误解决方法
- 解决PHP 7编译安装错误:cannot stat ‘phar.phar’: No such file or directory