天天看點

PHP編譯報錯​Sorry, I cannot run apxs. Possible reasons follow

在編譯PHP時候,用到--with-apxs2參數,但是遇到如下報錯:

<code>Sorry, I cannot run apxs. Possible reasons follow:</code>

<code>1. Perl is not installed</code>

<code>2. apxs was not found. Try to pass the path using --with-apxs2=</code><code>/path/to/apxs</code>

<code>3. Apache was not built using --</code><code>enable</code><code>-so (the apxs usage page is displayed)</code>

解決方法:

<code># yum install -y httpd-devel</code>

在将編譯參數--with-apxs2的路徑改成--with-apxs2=/usr/bin/apxs

注意,這裡的--with-apxs2是指apxs程式所在的路徑,并不是生成*.so檔案的存放路徑。有的文章使用這個路徑--with-apxs2=/usr/local/apache2/bin/apxs ,代表apache在編譯時就讓apache自帶apxs程式。

<code># ./configure  --with-apxs2=/usr/bin/apxs</code>

我在這裡被繞了一大圈。

參考文章:

本文轉自 piazini 51CTO部落格,原文連結:http://blog.51cto.com/wutou/1901689