2016-06-21 74 views
2

我試圖安裝PHP 5.4 PHPBrew但有那些錯誤:PHPBrew - 各種問題與安裝

-> % phpbrew install 5.4.6 +default +apxs2 +mysql        
===> phpbrew will now build 5.4.6 
===> Loading and resolving variants... 
Checking distribution checksum... 
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e 
===> Distribution file was successfully extracted, skipping... 
Found existing Makefile, running make clean to ensure everything will be rebuilt. 
You can append --no-clean option after the install command if you don't want to rebuild. 
===> Running make clean: /usr/bin/make -C '/home/breq/.phpbrew/build/php-5.4.6' --quiet 'clean' 
===> Checking patches... 
Checking patch for replace apache php module name with custom version name 
0 changes patched. 
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466515643 
===> Configuring 5.4.6... 


Use tail command to see what's going on: 
    $ tail -F /home/breq/.phpbrew/build/php-5.4.6/build.log 


===> Checking patches... 
Checking patch for php5.3.29 multi-sapi patch. 
Checking patch for php5.3.x on 64bit machine when intl is enabled. 
Checking patch for openssl dso linking patch 
===> Building... 
Error: Make failed: 
The last 5 lines in the log file: 
/home/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:355: undefined reference to `SSLv3_server_method' 

/home/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:343: undefined reference to `SSLv3_client_method' 

collect2: error: ld returned 1 exit status 

Makefile:244: recipe for target 'sapi/cli/php' failed 

make: *** [sapi/cli/php] Error 1 

Please checkout the build log file for more details: 
    tail /home/breq/.phpbrew/build/php-5.4.6/build.log 

隨着+openssl

-> % phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl 
===> phpbrew will now build 5.4.6 
===> Loading and resolving variants... 
Checking distribution checksum... 
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e 
===> Distribution file was successfully extracted, skipping... 
Found existing Makefile, running make clean to ensure everything will be rebuilt. 
You can append --no-clean option after the install command if you don't want to rebuild. 
===> Running make clean: /usr/bin/make -C '/home/breq/.phpbrew/build/php-5.4.6' --quiet 'clean' 
===> Checking patches... 
Checking patch for replace apache php module name with custom version name 
0 changes patched. 
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466516015 
===> Configuring 5.4.6... 


Use tail command to see what's going on: 
    $ tail -F /home/breq/.phpbrew/build/php-5.4.6/build.log 


Error: Configure failed: 
The last 5 lines in the log file: 
checking for Kerberos support... no 

checking for DSA_get_default_method in -lssl... no 

checking for X509_free in -lcrypto... yes 

checking for pkg-config... /usr/bin/pkg-config 

configure: error: Cannot find OpenSSL's <evp.h> 

Please checkout the build log file for more details: 
    tail /home/breq/.phpbrew/build/php-5.4.6/build.log 

我的OS:Xubuntu 16.10 + PHP 7.07

-> % tail /home/lmalicki/.phpbrew/build/php-5.4.6/build.log 
checking whether to enable LIBXML support... yes 
checking libxml2 install dir... /usr 
checking for xml2-config path... /usr/bin/xml2-config 
checking whether libxml build works... yes 
checking for OpenSSL support... yes 
checking for Kerberos support... no 
checking for DSA_get_default_method in -lssl... no 
checking for X509_free in -lcrypto... yes 
checking for pkg-config... /usr/bin/pkg-config 
configure: error: Cannot find OpenSSL's <evp.h> 

回答

0

我看起來像你缺少一些依賴關係。

嘗試首先安裝SSL dev軟件包:

apt-get install libssl-dev 

PHPBrew只是下載並編譯PHP,但它不會在你的操作系統安裝所需的依賴條件。

編輯:

我剛纔注意到您已經提供了用於+openssl=/usr/include/openssl OpenSSL庫的路徑。

你確定它在嗎?你可以用which openssl進行檢查。該命令將返回openssl二進制文件的路徑。

你也可以試着簡單地刪除路徑,因爲PHPBrew應該自己找到適當的二進制文件。

+0

- >%sudo易於得到安裝的libssl-dev的 讀取軟件包列表...完成 大廈的依賴關係樹 讀取狀態信息...完成 libssl-dev已經是最新版本(1.0.2h-1 + deb.sury.org〜xenial + 1)。 0升級,0新安裝,0刪除和40未升級。 – breq

+0

請看我更新的答案。 –

0

由於+ OpenSSL的指令實際上是提供了一個前綴不包括路徑,嘗試

+openssl=/usr -- --with-libdir=lib64 
+0

這種解決方案我有:檢查Kerberos支持......沒有 在-lssl檢查DSA_get_default_method ......沒有 在-lcrypto檢查X509_free ...是 檢查pkg配置.. 。/ usr/bin/pkg-config configure:error:找不到OpenSSL的庫 – breq

+0

您能粘貼整個構建日誌而不僅僅是包括configure命令在內的最後10行嗎? – canto

0
configure: error: Cannot find OpenSSL's <evp.h> 

,如果你有OpenSSL的較新版本可能會出現此問題裝那麼你的發行版提供。

如果你使用ubuntu,你可能需要將你的軟件包降級。 (但很可能你已經安裝的一個原因的不同版本,所以要小心這裏)

#file etc/apt/preferences.d/allow-downgrade 

Package: * 
Pin: release o=Ubuntu 
Pin-Priority: 1001 

然後

sudo apt-get update 
sudo apt-get upgrade 

和選項

-- --with-openssl=/path/to/libs 

+openssl 

應工作很好。

如果你已經從PHPbrew安裝了一些misfunctioning PHP不要忘記

phpbrew switch recently_installed_php_ver_number_here 
0

切換在Ubuntu 16。10

sudo apt-get install libssl-dev 
sudo apt-get install libcurl4-openssl-dev 
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev 

然後重新運行

phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl