Link to home
Start Free TrialLog in
Avatar of Sudhanshum
Sudhanshum

asked on

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.
SOLUTION
Avatar of Chris Harte
Chris Harte
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sudhanshum
Sudhanshum

ASKER

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.
Hi Dave Baldwin, I downloaded software then what should be next step?
Follow the directions and install it.
Is upgrading PHP an option?
we downloaded that but how to setup oracle connection?
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:
extension=php_oci8_11g.dll;

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:

<?php 
$connection = oci_connect($username, $password, $db);
if (!$connection) {
   $e = oci_error();
   echo htmlentities($e['message']);
}else{
   echo 'CONNECTED!';
}
?>

Open in new window

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A correctly edited php.ini and the newest drivers should do the trick.