php pdo oci安装失败,在CentOS 6.7 64位安装PHP的PDO_OCI扩展 Installing PDO_OCI extension on CentOS 6.7 64bit...

然后就是用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

执行成功, 没有报错。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值