how to connect oracle 9i to PHP on windows2007

I am using Oracle 9i database and PHP(5.6.33) for an application.
Application is showing PHP extension issue "None of the supported PHP extensions (OCI8, PDO_OCI) are available".
But i have tried to download couple of php extension named as OCI8.dll and PDO_OCI.dll to my PHP configuration file, but
still error is not going.Please help me on so I can connect oracle database with PHP.
Who is Participating?
NerdsOfTechConnect With a Mentor Technology ScientistCommented:
You are correct, my apologies; I had you copy over and uncomment the wrong version (11). You will need to re-comment the 11 version in php.ini. Download the newest oci8. 

Move over php_oci8.dll from the zip file to /ext (keep the /ext php.ini line uncommented) and enable the .dll (by uncommenting this line in php.ini):

Open in new window

IMPORTANT NOTE: Only one of these DLLs may be enabled (un-commented) at a time which means you can't access a 11i or 12i while running a 9.2 database.

PHP has fairly good documentation on installation, etc. here:

Oracle has an article too that's worth looking at:

EDIT: this isn't a simple task according to the LOADS of notes... My solution is likely incomplete and it sounds as if you tried this already.

Some notes mentioned Oracle Instant Client being part of the whole solution:

One note mentioned, "Welcome to Oracle hell", which may sum up the installation/implementation of oci8...

Your mileage may vary. Best of luck to you.
Chris HarteConnect With a Mentor ThaumaturgeCommented:
have you edited your php.ini file?
Search for oci8 and uncomment the line and pdo_oci as well.
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
You may also need to download the Oracle driver from their site.  See here:
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

SudhanshumAuthor Commented:
Hi Chris Harte, Yes I uncommented those lines and still I am getting error. What can be best solution so my  oracle 9i database can be connected with php server.
SudhanshumAuthor Commented:
Hi Dave Baldwin, I downloaded software then what should be next step?
Dave BaldwinFixer of ProblemsCommented:
Follow the directions and install it.
NerdsOfTechTechnology ScientistCommented:
Is upgrading PHP an option?
SudhanshumAuthor Commented:
we downloaded that but how to setup oracle connection?
NerdsOfTechTechnology ScientistCommented:
Presuming you know how to install PHP and have done so...

Extract the zip file you downloaded from Oracle to a directory; then copy just the php_oci8_11g.dll into the c:/php/ext directory.

In the php.ini file uncomment the following line:

Open in new window

Also set the extension directory to ./ext in the php.ini file.
extension_dir = "./ext"

Open in new window

Then in PHP:

$connection = oci_connect($username, $password, $db);
if (!$connection) {
   $e = oci_error();
   echo htmlentities($e['message']);
   echo 'CONNECTED!';

Open in new window

SudhanshumAuthor Commented:
Hi NerdsOfTech,

I was trying your solution, I was getting "Fatal error: Call to undefined function oci_connect() " issue.
I think the dll you suggested is compatible for Oracle 11g, but actually I am working on Oracle 9i. And I want connect with Oracle 9i.
I was already trying php_oci_11g and php_oci8 dlls, but both are not worked to connect Oracle 9i.
NerdsOfTechTechnology ScientistCommented:
A correctly edited php.ini and the newest drivers should do the trick.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.