2016-09-21 130 views
5

我試圖安裝Laravel的代客其中,作爲依賴,需要PHP 7.當我嘗試安裝PHP 7家釀與自制安裝PHP 7我得到以下錯誤:無法在MacOS塞拉利昂

Configuring SAPI modules 
checking for Apache 2.0 handler-module support via DSO through 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) 

The output of /usr/sbin/apxs follows: 
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!. 

configure: error: Aborting 

READ THIS: https://git.io/brew-troubleshooting 
If reporting this issue please do so at (not Homebrew/brew): 
    https://github.com/Homebrew/homebrew-php/issues 

These open issues may also help: 
php70-dbase https://github.com/Homebrew/homebrew-php/issues/3508 
php70-intl not found https://github.com/Homebrew/homebrew-php/issues/3591 
php70-opcache install issue https://github.com/Homebrew/homebrew-php/issues/3586 
Problem installing php70-mcrypt, php70-opcache, php70-xdebug on El Capitan https://github.com/Homebrew/homebrew-php/issues/3587 
Add php70-zmq formula https://github.com/Homebrew/homebrew-php/pull/3474 
Problem installing homebrew/php/php70-imagick https://github.com/Homebrew/homebrew-php/issues/3571 
Install PHP70: Incompatible library version https://github.com/Homebrew/homebrew-php/issues/3444 
brew install php70-redis https://github.com/Homebrew/homebrew-php/issues/2762 
Allow --enable-redis-igbinary for php70-redis https://github.com/Homebrew/homebrew-php/pull/3473 
Add head formula for php70-uploadprogress https://github.com/Homebrew/homebrew-php/pull/3178 

這是一個新鮮的MacOS塞拉利昂(實際發佈,一個beta)與全新安裝安裝自制軟件(更新)中。我已經安裝,運行並同意Xcode許可協議。

我不知道這些錯誤的意思或如何解決這些問題。任何人都可以提供幫助嗎?

感謝。

回答

9

右我已經想通了。我張貼的步驟成功的情況下,任何人絆倒在這個問題上安裝以下要求組件:

1)。確保Homebrew是最新的:

brew update 

2)。通過確保Xcode已安裝,然後在終端中輸入以下內容來修復PHP 7錯誤:

brew install apr apr-util 
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 
sudo ln -s /usr/local/opt/apr/bin/apr-1-config /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 
sudo ln -s /usr/local/opt/apr-util/bin/apu-1-config /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 

3)。運行以下命令(否則PHP安裝會抱怨丟失libz):

xcode-select --install 

4)。你現在可以用Homebrew安裝PHP 7:

brew install homebrew/php/php70 
1

我用下面的命令使它工作。

brew tap homebrew/dupes 
brew tap homebrew/versions 
brew tap homebrew/homebrew-php 
brew update && brew install apr apr-util 
brew link apr-util --force 
brew link apr --force 
which apu-1-config 
which apr-1-config 
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 
sudo ln -s /usr/local/bin/apu-1-config /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 
sudo ln -s /usr/local/bin/apr-1-config /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/ 
brew install php70 
2

這也可能是通過自制那(引自家釀php70安裝)使用Apache的MacOS的交付安裝使用PHP那些重要:

和MacOS塞拉利昂發佈的Apache模塊是現在不是默認生成的。如果你想在你的系統上構建它,你必須使用--with-apache選項安裝php。有關更多詳細信息,請參閱brew選項php70。

+0

的--with-apache的選項現在已經過時,使用--with-httpd24代替 –

相關問題