php安装oracle扩展方法
1、这两个包是必须安装的
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

2、rpm -ivh oracle-instantclient11.2-*

3、ln -s /usr/include/oracle/11.2/client64 /usr/include/oracle/11.2/client
ln -s /usr/lib/oracle/11.2/client64 /usr/lib/oracle/11.2/client

4、编辑配置文件
vi /etc/profile.d/oracle.sh
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
source /etc/profile.d/oracle.sh

5、获取PDO_OCI-1.0.tgz
tar -xvf PDO_OCI-1.0.tgz
cd PDO_OCI-1.0

6、需要编辑ODI_OCI-1.0文件夹里的config.m4文件来让它支持11g
elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.11.2; then
PDO_OCI_VERSION=11.2
# 在第101行左右添加这几行:
11.2)
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
;;


7、[root@vm-122-242 PDO_OCI-1.0]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
[root@vm-122-242 PDO_OCI-1.0]# ./configure --with-pdo-oci=instantclient,/usr,11.2 --with-php-config=/usr/local/php/bin/php-config

8、make && make install

9、报错"error: unknown type name ‘function_entry’"

10、Just Change function_entry To zend_function_entry in your pdo_oci.c file
将pdo_oci.c file 中的function_entry改成zend_function_entry
34行左右
保存并退出

11、扩展安装成功
