tags:

views:

695

answers:

1

I am trying to connect to my oracle database using PDO but I am getting Class PDO not found error. I have checked that PDO is enabled and it appears so. Still I am not able to trace why I am getting this error. Here is my configure command,

cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" 
"--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" 
"--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" 
"--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" 
"--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"

PHP ver : 5.2.8 Oracle: 10.2

This is the code I am using to connect to the db.

try{
    $conn = new PDO("oci:dbname=".$oc_db,$oc_user,$oc_pass);
}catch(PDOException $e){
    echo ($e->getMessage());
}

Can there be any other reason that I am getting this error? Any help appreciated.

A: 

This generally means the PDO extension in question isn't compiled and set up so PHP can use it. What operating system are you compiling PHP on?

I'm not sure if PDO core module is compiled if you only specify to compile the oracle extension of it (PDO-OCI).

You should check out the PHP manual regarding how to install and enable the PDO module.

You should look at these sites: http://is.php.net/manual/en/pdo.installation.php http://is.php.net/manual/en/ref.pdo-oci.php

Kristinn Örn Sigurðsson
I (actually, my webmaster) am compiling it on Windows Box. I think he had not installed the PDO_OCI but it was sorted out. Thanks.
Chantz