我正在尝试在oracle 11和php5.3下的Centos 5.11中安装oci8-1.4.9,但我在使用时遇到错误
pecl install oci8-1.4.9
错误
config.status: creating config.h
running: make
/bin/sh /var/tmp/pear-build-root/oci8-1.4.9/libtool --mode=compile gcc -I. -I/tmp/tmp9GRxQr/oci8-1.4.9 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/oci8-1.4.9/include -I/var/tmp/pear-build-root/oci8-1.4.9/main -I/tmp/tmp9GRxQr/oci8-1.4.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp9GRxQr/oci8-1.4.9/oci8.c -o oci8.lo
mkdir .libs
gcc -I. -I/tmp/tmp9GRxQr/oci8-1.4.9 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/oci8-1.4.9/include -I/var/tmp/pear-build-root/oci8-1.4.9/main -I/tmp/tmp9GRxQr/oci8-1.4.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/tmp9GRxQr/oci8-1.4.9/oci8.c -fPIC -DPIC -o .libs/oci8.o
In file included from /tmp/tmp9GRxQr/oci8-1.4.9/oci8.c:58:
/tmp/tmp9GRxQr/oci8-1.4.9/php_oci8_int.h:56:17: error: oci.h: No such file or directory
In file included from /tmp/tmp9GRxQr/oci8-1.4.9/oci8.c:58:
/tmp/tmp9GRxQr/oci8-1.4.9/php_oci8_int.h:113: error: expected specifier-qualifier-list before 'OCIEnv'
/tmp/tmp9GRxQr/oci8-1.4.9/php_oci8_int.h:122: error: expected specifier-qualifier-list before 'OCIEnv'
/tmp/tmp9GRxQr/oci8-1.4.9/php_oci8_int.h:152: error: expected specifier-qualifier-list before 'dvoid'
....
/tmp/tmp9GRxQr/oci8-1.4.9/oci8.c:3309: error: 'php_oci_spool' has no member named 'spool_hash_key'
/tmp/tmp9GRxQr/oci8-1.4.9/oci8.c: At top level:
/tmp/tmp9GRxQr/oci8-1.4.9/oci8.c:3321: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_oci_ping_init'
make: *** [oci8.lo] Error 1
ERROR: `make' failed
我该如何解决?
答案 0 :(得分:5)
我在Ubuntu 14.04 LTS和OCI扩展上遇到了类似的问题。
我通过'外星人'安装了Oracle Instant Client。工具包并设置LD库路径和ORACLE_HOME环境。命令sqlplus正在运行,我可以访问oracle数据库。
OCI PHP / PECL接口的安装并没有开箱即用。库和二进制文件位于' /usr/lib/oracle/12.1/client64'目录中。并且include标题位于' /usr/include/oracle/12.1/client64'
In file included from /tmp/pear/temp/oci8/oci8.c:48:0:
/tmp/pear/temp/oci8/php_oci8_int.h:60:17: fatal error: oci.h: No such file or directory
#include <oci.h>
我们必须通过编译器环境
获取包含pecl的路径 C_INCLUDE_PATH=/usr/include/oracle/12.1/client64 pecl install oci8-2.0.12
现在pecl安装工作了:)我希望它在CentOS上会出现同样的问题。