且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP编译报错​Sorry, I cannot run apxs. Possible reasons follow

更新时间:2022-01-14 03:27:33

在编译PHP时候,用到--with-apxs2参数,但是遇到如下报错:

1
2
3
4
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)


解决方法:

1
# yum install -y httpd-devel

在将编译参数--with-apxs2的路径改成--with-apxs2=/usr/bin/apxs

注意,这里的--with-apxs2是指apxs程序所在的路径,并不是生成*.so文件的存放路径。有的文章使用这个路径--with-apxs2=/usr/local/apache2/bin/apxs ,代表apache在编译时就让apache自带apxs程序。

1
# ./configure  --with-apxs2=/usr/bin/apxs



我在这里被绕了一大圈。




参考文章:

https://zhidao.baidu.com/question/332795586.html (感谢me_8的***答案)




本文转自 piazini 51CTO博客,原文链接:http://blog.51cto.com/wutou/1901689