然后就是用phpize这个工具进行编译安装:
$ phpize//如果系统提示没有找到这个命令,只需要安装php-devel即可//$ yum install php-devel
$ ./configure --with-pdo-oci=instantclient,/usr,11.2$make$sudo make install
我在运行 ./configure --with-pdo-oci=instantclient,/usr,11.2后得到一个错误: checking for oci.h... configure: error: I‘m too dumb to figure out where the include dir is in your instant client install 意思是说, 没有找到instant client 的include 文件夹, 这是为什么呢?继续google, 这个问题不多见,我花了很多时间在这个问题上面。最后看到一片文章下的评论:
Changes for x86_64 November 10th 2010 at 09:11 am Some changes were required to get the configure to work on a 64 bit Redhat (Fedora 13) system.
We installed the 64 bit version of oracle-instantclient-{devel,basic}.
These installed in:
/usr/lib/oracle/11.2/client64
/usr/include/oracle/11.2/client64
We created symlinks as follows:
/usr/lib/oracle/11.2/client -> /usr/lib/oracle/11.2/client64
/usr/include/oracle/11.2/client -> /usr/include/oracle/11.2/client64
Then the "./configure --with-pdo-oci=instantclient,/usr,11.2" command worked fine!
The reason for the symlinks instead of changing the variables in the oracle.sh is that the build/configure scripts seem to be hard coded for "client" (not client64) in many places. It was easer to create 2 symlinks than to change all the code in every script/config file.
非常感谢这问网友。大概意思是在configure时查找的文件夹是/usr/lib/oracle/11.2/client 和/usr/include/oracle/11.2/client, 这两个文件夹位置的组成方式是:${prefix}/lib OR lib/oracle/${version}/client,而64bit 的Instant Client的安装目录都是client64,所以configure的时候找不到,解决这个问题只需要添加两个符号链接即可:
$ ln -s /usr/lib/oracle/11.2/client64 /usr/lib/oracle/11.2/client
$ln -s /usr/include/oracle/11.2/client64 /usr/include/oracle/11.2/client
添加好符号链接后,再次执行
$ ./configure --with-pdo-oci=instantclient,/usr,11.2$make$sudo make install
执行成功, 没有报错。