PHP, PEAR, and oci8 configuration

Posted by zack_falcon on Stack Overflow See other posts from Stack Overflow or by zack_falcon
Published on 2013-11-11T08:31:21Z Indexed on 2013/11/12 3:55 UTC
Read the original article Hit count: 163

Filed under:
|
|

I'll make this quick.

I installed Oracle 11g (with appropriate database, users, etc), Apache 2.4.6, and PHP 5.5.4 on a Fedora 19 system.

I wanted to connect PHP to Oracle. What I really wanted to do was to download MDB2_Driver_oci8, which I thought would be easy, but before I can do such a thing, PHP needs to have that plug-in enabled, so here's what I did:

  • Tried to install oci8 via the following: pecl install oci8
  • When that didn't exactly work the first few times, I figured out I, for some reason, needed "Development tools" - via yum groupinstall "Development Tools"
  • Then I figured out later that PHP actually doesn't do oci8 - it's PHP Devel. So, I had to install that too, via yum install php-devel.
  • And then, I finally got to install oci8. It asked for the Oracle Directory, and that was that. But it said the following:
    Configuration option 'php_ini' is not set to php.ini location
    You should add 'extensions=oci8.so' to php.ini

First, I did a locate oci8.so - found it in /usr/lib64/php/modules/
Second, I added what it told me to, to the php.ini file.
Third, I checked the usual php_info() test page - no mention of OCI8. Uh-oh.
Fourth, running both php -i and php -m listed oci8 as one of the modules. Weird.
In desperation, I went ahead and downloaded the MDB2_Driver_oci8. Maybe that will fix things. Nope.

When I loaded my PHP Webpage, it returned the following:
Error message: extension oci8 is not compiled into PHP
As well as: MDB2 error: not found

Strange. And then I decided to check the error logs:
PHP Startup - unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0

And now I'm stuck. I tried going into the php.ini, and found that the extension_dir was commented out. I put it back in, which only seemed to break stuff.

Things of note:

  • I followed this (link) guide on how to configure PHP and install oci8.
  • ./configure --with-oci8 doesn't work. Fedora says no such directory.
  • As both the webpage files and the actual server reside on the same PC, I did not install the Oracle Client files.
  • The extension_dir is commented out by default in the php.ini.

This is just one of my problems in a long line of problems concerning the replication of an already existing and working, but dying, setup. It seems whenever I want to solve a problem, I have to do X first. And by doing X, I uncover another problem, which I have to solve by doing Y, which has its own problems, etc, etc.

Any help would be much appreciated. Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about fedora