在php 5.5.0(Solaris 10)中启用OCI8和ldap /如何动态添加OCI8

时间:2013-07-12 20:27:01

标签: php makefile ldap solaris instantclient

使用以下配置语句:

./configure --prefix=/home/a2r/www/PHP-5.5.0 --with-apxs2=/home/a2r/apache/bin/apxs --enable-ftp --with-curl --with-zlib --with-gd --with-ldap --with-mm --with-pgsql --with-jpeg-dir=/home/a2r/www --with-png-dir=/home/a2r/www  --with-imap=/home/a2r/www/imap-2007f --with-imap-ssl --with-oci8=instantclient,/home/a2r/www/oracle/instantclient --enable-opcache=no

./ configure成功运行,但是当我运行make时出现以下错误:

In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:96:1: warning: "LBER_ERROR" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:53:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:97:1: warning: "LBER_DEFAULT" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:54:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:100:1: warning: "LBER_BOOLEAN" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:72:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:101:1: warning: "LBER_INTEGER" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:73:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:102:1: warning: "LBER_BITSTRING" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:74:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:103:1: warning: "LBER_OCTETSTRING" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:75:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:104:1: warning: "LBER_NULL" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:76:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:105:1: warning: "LBER_ENUMERATED" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:77:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:106:1: warning: "LBER_SEQUENCE" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:78:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:107:1: warning: "LBER_SET" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:79:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:145:1: warning: "NULLBER" redefined
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:27,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:
/usr/include/lber.h:96:1: warning: this is the location of the previous definition
In file included from /home/a2r/www/php-5.5.0/ext/ldap/php_ldap.h:30,
             from /home/a2r/www/php-5.5.0/ext/ldap/ldap.c:45:

/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:191: error: redefinition of `struct berval'
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1011: error: conflicting types for 'ber_init'
/usr/include/lber.h:174: error: previous declaration of 'ber_init' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1011: error: conflicting types for 'ber_init'
/usr/include/lber.h:174: error: previous declaration of 'ber_init' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1012: error: conflicting types for 'ber_peek_tag'
/usr/include/lber.h:150: error: previous declaration of 'ber_peek_tag' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1012: error: conflicting types for 'ber_peek_tag'
/usr/include/lber.h:150: error: previous declaration of 'ber_peek_tag' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1013: error: conflicting types for 'ber_skip_tag'
/usr/include/lber.h:148: error: previous declaration of 'ber_skip_tag' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1013: error: conflicting types for 'ber_skip_tag'
/usr/include/lber.h:148: error: previous declaration of 'ber_skip_tag' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1014: error: conflicting types for 'ber_scanf'
/usr/include/lber.h:168: error: previous declaration of 'ber_scanf' was here
/home/a2r/www/oracle/instantclient/sdk/include/ldap.h:1014: error: conflicting types for 'ber_scanf'
/usr/include/lber.h:168: error: previous declaration of 'ber_scanf' was here
make: *** [ext/ldap/ldap.lo] Error 1

如果我从configure命令中删除了instantclient部分(最后2个),则./configure,make和make install似乎运行正常。

根据我对此所做的研究,看起来ldap和OCI8并不能很好地发挥作用是一个众所周知的“问题”:https://forums.oracle.com/thread/2368820

如果这是我的问题,它应该是什么问题,如何在不使用oci8的情况下运行configure,然后将其添加为动态.so模块?目前,似乎不存在php.ini文件。提前谢谢。

1 个答案:

答案 0 :(得分:0)

对此最好的解决方案是动态配置oci8模块。为此,我不得不复制php.ini开发文件:

cp php.ini-development /usr/local/lib/php.ini

然后,我将以下行添加到php.ini中,以便动态运行oci8:

Extension=oci8.so

PHP / Apache指南也是一个有用的资源:http://php.net/manual/en/install.unix.apache2.php