pdo_oci

SrWebDeveloper

macrumors 68000
Original poster
Dec 7, 2007
1,872
2
Alexandria, VA, USA
Having problems compiling PHP 5.3.2 pdo_oci.

I have the Oracle instant client installed and it compiled fine along with pdo_mysql and a few others PDO drivers. When I check phpinfo() pdo_oci is listed as being installed along with the others in the PDO section, but under PDO_OCI it's blank where I expect to see driver name and version.

No errors during any process in compiling. PHP works fine otherwise for all the other drivers and extensions I opted to use for the compile. Nothing else is broken, is the point.

When testing pdo_oci in my PHP code to access my Oracle database, none of the PDO commands even exist. I also compiled OCI8 access and it works great, as an FYI.

My platform:

RHEL5
PHP 5.3.2
Oracle Instant Client 11.2

./configure --with-mcrypt --enable-zip --enable-soap --with-freetype-dir --with-gd --with-jpeg-dir --with-apxs2=/usr/sbin/apxs --with-zlib --enable-bcmath --with-mysql --with-mysqli --enable-mbstring --enable-sigchild --with-pdo-mysql --with-oci8=instantclient,/opt/instantclient --with-pdo-oci=instantclient,/opt/instantclient,11.2

(Path's are correct otherwise .configure would bomb)

Note: I do not want to use the PECL 1.0 version of PDO_OCI it's an older version. I know PHPs native version is experimental.
 

Cabbit

macrumors 68020
Jan 30, 2006
2,128
1
Scotland
Can't get it working myself, but keep your eyes on PHPBuilder there really friendly and helpful.
 

SrWebDeveloper

macrumors 68000
Original poster
Dec 7, 2007
1,872
2
Alexandria, VA, USA
Can't get it working myself, but keep your eyes on PHPBuilder there really friendly and helpful.
Same symptoms as mine? If not, what did you experience?

Yep, I always keep my eye on all the topics I'm involved with.

I'm thinking at this point to attempt compiling it manually so I can create a pdo_oci.so myself and enable the extension in my php.ini. The problem is, I only could find info on how to compile the thirdparty PECL 1.0 version, which I believe is older and more buggy than the experimental PHP 5.3.2 version. So if you have any insight on how to compile the one that ships with PHP manually, let me know!

-jim
 

Cabbit

macrumors 68020
Jan 30, 2006
2,128
1
Scotland
It would not let me compile it complained about missing dependences despite me having these installed.
This was tested on Centos 5 x86_64, I am sorry i did not think to copy the output. I have posted a email to my lecturer regarding the problem he is quite comfortable with oracle databases and i know our intranet for course submissions is on PHP 5.x with a oracle database.

This may be a PHP 5.3.x issue, i know for a while things like ioncube did not work and perhaps some of the database drivers are not updated yet.
 

SrWebDeveloper

macrumors 68000
Original poster
Dec 7, 2007
1,872
2
Alexandria, VA, USA
I finally got it to compile as external module (.so) - and it works, even though no version information is supplied in phpinfo() for that extension. Now I have my PHP supporting PDO for MySQL and Oracle, plus OCI8 as well (due to Drupal and some legacy DB support for this client, it's odd, I know).

Thanks so much for your help! Marking this one resolved.

-jim
 

Cabbit

macrumors 68020
Jan 30, 2006
2,128
1
Scotland
I finally got it to compile as external module (.so) - and it works, even though no version information is supplied in phpinfo() for that extension. Now I have my PHP supporting PDO for MySQL and Oracle, plus OCI8 as well (due to Drupal and some legacy DB support for this client, it's odd, I know).

Thanks so much for your help! Marking this one resolved.

-jim
Would be interested to see your solution, though rare would i ever be asked to work with a Oracle database.
 

SrWebDeveloper

macrumors 68000
Original poster
Dec 7, 2007
1,872
2
Alexandria, VA, USA
./configure --with-config-file-path=/etc --with-mcrypt --enable-zip --enable-soap --with-freetype-dir --with-gd --with-jpeg-dir --with-apxs2=/usr/sbin/apxs --with-zlib --enable-bcmath --with-mysql --with-mysqli --enable-mbstring --enable-sigchild --with-oci8=instantclient,/opt/instantclient --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared --with-pdo-oci=shared,instantclient,/opt/instantclient,11.2

Add to /etc/php.ini:

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
extension=pdo_oci.so
 

Cabbit

macrumors 68020
Jan 30, 2006
2,128
1
Scotland
./configure --with-config-file-path=/etc --with-mcrypt --enable-zip --enable-soap --with-freetype-dir --with-gd --with-jpeg-dir --with-apxs2=/usr/sbin/apxs --with-zlib --enable-bcmath --with-mysql --with-mysqli --enable-mbstring --enable-sigchild --with-oci8=instantclient,/opt/instantclient --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared --with-pdo-oci=shared,instantclient,/opt/instantclient,11.2

Add to /etc/php.ini:

extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
extension=pdo_oci.so
Interestingly looks about the same process i had to do to get PDO MySQL working on 5.3.2. Once again making me wonder if it is a PHP 5.3 issue that it did not work right the first time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.