ober Posted June 7, 2011 Share Posted June 7, 2011 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! Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/ Share on other sites More sharing options...
xylex Posted June 7, 2011 Share Posted June 7, 2011 I take it you're running this in Windows? Did you get the OCI8 and PDO_OCI dll's and put them in your PHP extensions folder? Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/#findComment-1226626 Share on other sites More sharing options...
ober Posted June 7, 2011 Author Share Posted June 7, 2011 Yes, sorry. Windows 7 Ultimate 32 bit. Yes, all of the DLLs are in place in the extension folder. I did the manual installation of PHP so everything is there. Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/#findComment-1226627 Share on other sites More sharing options...
ober Posted June 7, 2011 Author Share Posted June 7, 2011 http://www.php.net/manual/en/ref.pdo-oci.php Are those '--with' directives only for compiling or can I put those references somewhere? Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/#findComment-1226638 Share on other sites More sharing options...
xylex Posted June 7, 2011 Share Posted June 7, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/#findComment-1226667 Share on other sites More sharing options...
ober Posted June 8, 2011 Author Share Posted June 8, 2011 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). Quote Link to comment https://forums.phpfreaks.com/topic/238704-pdo_oci-pdo-for-oracle-please-read-even-if-you-dont-know-oracle/#findComment-1226955 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.