时间:2021-07-01 10:21:17 帮助过:8人阅读
php在安装时全出现很多问题,但一般安装到最后都会有提示错误在哪里.
然后yum install -y xxx 就可以了。昨天在家里安装时还算顺利,出现的问题都解决了。但今天在公司里安装时却出现这样问题,搞了好久,然后上网查资料,终于搞明白。问题如下:
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
首先,通过错误提示,我们得知"I cannot rum apxs". 我一直以为是apxs安装有问题,但找了很久仍未得到合理的解释和解决方法.
于是我直接运行"/usr/local/apache/bin/apxs"这个脚本,得到下面的错误提示:
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
运行"vi /usr/local/apache/bin/apxs"得到下面内容:
#!/replace/with/path/to/perl/interpreter -w
最后发现这里没有指明正确的perl执行程序的位置!
把这一行更改为"#!/usr/bin/perl -w". 再运行php的!./configure就可以了