2011-06-09 20:18 阅读 61

使用REMI存储库在rhel 6上设置oci8

I've done this before, but it was a long trial and error process that resulted with my test machine having multiple copies of php, oci8, and the instant client, and I'm still not sure what it was that I did that made it work.

So far, i've set up yum to use the remi repository, done yum install php php-oci8 php-pdo, and downloaded the oracle instant client and done rpm -Uh oracle-instantclient11.2-basic-\ \(1\).rpm

When I do phpinfo() on a page though, it still doesn't list oci8 as one of the modules.

I think the error is with the ORACLE_HOME environment variable, but I'm not sure what it's supposed to be set to. right now i have:

SetEnv LD_LIBRARY_PATH /usr/lib/oracle/11.2/client64/lib
SetEnv ORACLE_HOME /usr/lib/oracle/11.2

in /etc/httpd/conf/httpd.conf

The last time I got this working I think I just kept on uninstalling php and php-oci8 and re-installing until things worked.

My working server has ORACLE_HOME set like this: working server

But the new non working one has ORACLE_HOME set here:

non-working server

how do i set the ORACLE_HOME that is in the Enviroment section of phpinfo()?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    duanpai1033 duanpai1033 2011-06-13 21:54

    After some trial and error, I found the answer to the issue. I installed oci8 with PECL instead of using yum and the REMI repository, but I think this should work for installing it with yum too.

    Solution: turn selinux off (put it in permissive mode). This is actually oracle's suggested solution. You have to turn it off before installation to get it to install properly, and keep it off to get it to work properly.

    点赞 评论 复制链接分享
  • dtvdz911959 dtvdz911959 2011-06-10 01:50

    I'm not sure why what's showing up in your Apache Environment is different from what's in your httpd.conf file unless you changed something, but you can set an environment variable with putenv so something like putenv("ORACLE_HOME=" . $_SERVER['ORACLE_HOME']); at the top of your code may work. Or hard-code the value if need be.

    点赞 评论 复制链接分享