我正在尝试在 Fedora 17 上为我的 php 安装 json 扩展。
我从这里下载了软件包
http://pecl.php.net/get/json-1.2.1.tgz
并在目录中运行phpize
,然后配置,一切正常。
但是当我运行make时,出现了此错误。
我已经搜索了错误,但没有出现解决方案。
有什么建议吗?
我必须在我的 php 中执行此操作.ini配置我得到了"--disable-json"
当我运行 pecl 安装 json 以启用扩展时,请向我显示 pecl 的其他错误。我想从 pecl 手动编译包!
谢谢!
谢谢
[juan@fedoris 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
您下载的软件包是在 2006 年发布的,适用于 php 4。您不太可能将其编译为 php 5.4.5 的扩展。最好在 phpinfo() 中删除--disable-json
后,使用 phpinfo() 中的"配置命令"重新编译 php。