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就可以了