Jump to content

PDO_OCI (PDO for Oracle) - please read even if you don't know oracle


Recommended Posts

I am trying to get Apache 2.2 and PHP 5.3.6 up and going and connected to an Oracle database.

 

I have Apache and PHP playing nicely at this point.  My problem is the PDO driver for Oracle.  I've uncommented the php_pdo_oci extension in php.ini and it seems to be adding it in after an Apache restart but the driver isn't there.

 

The weird part is that this is in the configure command in phpinfo:

 

"--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "

 

Those paths don't even exist.  I don't even have a D drive.  I think maybe if I could change those it would work.

 

OH, and I'm trying to use PHPActiveRecord, which only has a PDO extension for Oracle... which is why I'm trying to get PDO working.

 

But when I go to a page that actually calls for a connection using PDO, it just says that it can't find the driver.

 

Can anyone help me??  I've been stuck on this for 2 days!

Link to comment
Share on other sites

Those directives are just for whomever compiled the dll's you're using, you don't need to do anything with them.

 

I've uncommented the php_pdo_oci extension in php.ini

 

Did you also uncomment the php_oci extension?  Is the oci section showing up on your php_info() page?  The PDO_OCI extension is experimental, most of the work that Oracle's two guys have been doing have been in the straight OCI extension.  You might want to start by getting the regular OCI extension working first before using the PDO wrapper.

Link to comment
Share on other sites

Ok, got it figured out.  I swear I added the path to the oracle instant client to the windows PATH previously but I guess not.  So here are the steps needed if anyone else needs to do this on Windows:

 

1) Follow this tutorial with the latest versions of Apache/PHP: http://www.vertstudios.com/blog/php-apache-installation-tutorial/

2) Follow the notes here: http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html, specifically this section: Enabling the PHP OCI8 Extension on Windows

3) Make sure the OCI8 and the PDO OCI extensions are enabled in PHP.

4) Profit (or something).

 

:D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.