2012-08-06 35 views
1

我試圖在Fedora安裝JSON擴展我的PHP安裝PHP的JSON擴展17錯誤從源頭

我從這裏

http://pecl.php.net/get/json-1.2.1.tgz

下載的軟件包,並在跑phpize目錄,然後進行配置,一切正常。

但是當我運行make時,出現這個錯誤。

我搜索了錯誤,但沒有解決方案出現。

有什麼建議嗎?

我不得不這樣做becouse在我的php.ini配置我得到了「 - 禁用JSON」

當我運行PECL安裝啓用擴展JSON,讓我與PECL其他錯誤。 我想從pecl手動編譯包!

謝謝!

感謝

[[email protected] json-1.2.1]$ sudo make 
[sudo] password for juan: 
/bin/sh /home/juan/recursos/json-php/json-1.2.1/libtool --mode=compile cc -I. -I/home/juan/recursos/json-php/json-1.2.1 -DPHP_ATOM_INC -I/home/juan/recursos/json-php/json-1.2.1/include -I/home/juan/recursos/json-php/json-1.2.1/main -I/home/juan/recursos/json-php/json-1.2.1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/juan/recursos/json-php/json-1.2.1/json.c -o json.lo 
cc -I. -I/home/juan/recursos/json-php/json-1.2.1 -DPHP_ATOM_INC -I/home/juan/recursos/json-php/json-1.2.1/include -I/home/juan/recursos/json-php/json-1.2.1/main -I/home/juan/recursos/json-php/json-1.2.1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/juan/recursos/json-php/json-1.2.1/json.c -fPIC -DPIC -o .libs/json.o 
/home/juan/recursos/json-php/json-1.2.1/json.c:44:1: error: unknown type name ‘function_entry’ 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: braces around scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: initialization makes integer from pointer without a cast [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: braces around scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: initialization makes integer from pointer without a cast [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: braces around scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: initialization makes integer from pointer without a cast [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: excess elements in scalar initializer [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:58:5: warning: initialization from incompatible pointer type [enabled by default] 
/home/juan/recursos/json-php/json-1.2.1/json.c:58:5: warning: (near initialization for ‘json_module_entry.functions’) [enabled by default] 
make: *** [json.lo] Error 1 
+1

從PHP 5.2.0開始,默認情況下,JSON擴展被捆綁並編譯到PHP中。你爲什麼要編譯自己的?! – Florent 2012-08-06 15:50:39

+0

Becouse我沒有它。 – user1579686 2012-08-06 16:14:47

+0

我有php-5.4.5軟件包安裝在我的php它說 致命錯誤:調用未定義的函數Monolog \ Formatter \ json_encode() – user1579686 2012-08-06 16:15:05

回答

0

你已經下載發佈於2006年,在PHP 4這是不可能的,你可以編譯它作爲一個擴展您的PHP 5.4.5包。正如指出的那樣,從phpinfo()中刪除--disable-json後,最好使用「Configure Command」重新編譯php。

+0

air4x,謝謝你的建議 – user1579686 2012-08-07 00:49:23

+0

但是,我必須問。如果我已經從yum包管理器安裝了PHP,是否可以重新編譯php? – user1579686 2012-08-07 00:49:52

+0

如果你是通過yum安裝的,你可以嘗試http://stackoverflow.com/questions/7979864/php-5-3-8-json-centos-6中描述的步驟 – air4x 2012-08-07 03:48:53