2014-06-27 81 views
1

我在我的系統上安裝了Apache 2.4在FreeBSD 10安裝PHP提供了編譯錯誤

./configure --enable-so 

那麼MySQL得到了設置和使用沒有問題的運行。但現在我想用這些參數安裝PHP:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql 

而且在使我收到的錯誤:

ext/standard/info.o: In function `php_info_print': 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
ext/standard/info.o: In function `php_info_printf': 
/root/php-5.5.13/ext/standard/info.c:83: undefined reference to `ts_resource_ex' 
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow 
ext/standard/info.o: In function `php_print_info': 
/root/php-5.5.13/ext/standard/info.c:869: undefined reference to `executor_globals_id' 
/root/php-5.5.13/ext/standard/info.c:872: undefined reference to `executor_globals_id' 
/root/php-5.5.13/ext/standard/info.c:875: undefined reference to `executor_globals_id' 
/root/php-5.5.13/ext/standard/info.c:878: undefined reference to `executor_globals_id' 
ext/standard/info.o: In function `php_info_print': 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow 
ext/standard/info.o: In function `php_print_gpcse_array': 
/root/php-5.5.13/ext/standard/info.c:204: undefined reference to `executor_globals_id' 
ext/standard/info.o: In function `php_info_print': 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
/root/php-5.5.13/ext/standard/info.c:97: undefined reference to `ts_resource_ex' 
ext/standard/info.o: In function `php_info_print_html_esc': 
/root/php-5.5.13/ext/standard/info.c:69: undefined reference to `ts_resource_ex' 
ext/standard/info.o:/root/php-5.5.13/ext/standard/info.c:97: more undefined references to `ts_resource_ex' follow 
cc: error: linker command failed with exit code 1 (use -v to see invocation) 
*** Error code 1 

Stop. 
make: stopped in /root/php-5.5.13 

點我在正確的方向PLZ :)

回答

1

FreeBSD有ports collection。這是用於各種軟件包的構建基礎結構。如果你想從港口獲得什麼,最好使用它。因爲其他人已經想出瞭如何最好地安裝程序。

E.g.要安裝php5,請切換至root用戶,請轉至/usr/ports/lang/php5並指定make install clean。這將爲您編譯和安裝PHP,包括它所依賴的任何東西。

很多端口都帶有選項;您可以更改的配置項目。如果您對端口的默認配置沒有問題,則可以將其作爲預先構建的軟件包進行安裝。例如。尋找一個PHP 5包;

> pkg search php5|less 
ja-php5-mecab-0.5.0 
mod_php5-5.4.29,1 
mod_php55-5.5.13 
php5-5.4.29 
php5-Ice-3.5.1 
php5-arcanist-20140508_2 
php5-bcmath-5.4.29 
php5-blitz-0.8.2 
php5-blitz-devel-0.7.2 
php5-bsdconv-11.1.0 
... 

然後安裝你想要的;

# pkg install php5-5.4.29 
Updating repository catalogue 
The following 1 packages will be installed: 

    Installing php5: 5.4.29 

The installation will require 15 MB more space 

2 MB to be downloaded 

Proceed with installing packages [y/N]: y 

編輯:要獲得libphp5.so,你需要激活嵌入選項。這不是默認值,所以你不能在這種情況下使用包。

+0

如果我從端口安裝,不會創建文件libphp5.so –

+1

@Nordenheim檢查端口的'pkg-plist';你必須啓用EMBED選項來獲得'libphp5.so'。 –