Muntashir Are Rahi
Muntashir Are Rahi

Reputation: 65

Oracle DB connection with PHP

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?

Upvotes: 1

Views: 1973

Answers (1)

Alex P
Alex P

Reputation: 602

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

Upvotes: 1

Related Questions