1

I want to connect PHP with oracle DB. I have written the following code

<?php
$db_user='system';
$db_pass='19941992';
$db_name="webproj";

        $connection = oci_connect($db_name,$db_pass,'localhost/ORCL');
        if (!$connection) { 
    echo "Couldn't make a connection!"; 
    exit; 
    } 

?>

But its showing an error Fatal error: Call to undefined function oci_connect()

NB. I have installed php_oci8.dll . How can i solve this?

3
  • Does php_info() confirm it is active? Commented Apr 9, 2013 at 21:33
  • Did you add your dll to php.ini? is it correct php.ini? did you restart server? Commented Apr 9, 2013 at 21:34
  • Yes , I have corrected it. Commented Apr 10, 2013 at 19:58

1 Answer 1

1

In order to use oci8 module, beside enabling php_oci8.dll you need to have installed an Oracle Client.
You can try Oracle 10gR2 Instant Client or Oracle 11gR2 Instant Client

Download from here: http://www.oracle.com/technetwork/topics/winsoft-085727.html
I suggest version 10.2.0.5, Instant Client Package - Basic Lite

Sign up to request clarification or add additional context in comments.

3 Comments

Oracle Express 10g is installed in my machine. Do i need to install Oracle instant client afterwards?
run php from command line and check if there are any errors or run php -m to see loaded modules
enabling mod_fcgid module stops starting apache server. Note that i have 64 bit Windows, But mod_fcgit is 32 bit. Where i can get a 64 bit module?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.