Connect to Oracle 10

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Connect to Oracle 10

Post by papa »

Hi,

I'm trying to connect to an Oracle (10) db but can't get it to work.

Doesn't seem that you have to do that much. I activated the extension php_pdo_oci.dll in php.ini and restarted Apache.

I get:
could not find driver

Code: Select all

 
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1); 
 
$username = "xxx";
$password = "xxx";
$host = "xxx";
$dbname = "xxx";
 
try {
    $dbh = new PDO("OCI:dbname=$dbname", $username, $password);
    }
catch (PDOException $e)
    {
    echo $e->getMessage();
    }
?>
 
Been reading about it but don't understand why my extension doesn't work or what I'm doing wrong.

Running Windows XP, PHP 5+, Apache 2+
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Connect to Oracle 10

Post by papa »

*bump*
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Connect to Oracle 10

Post by papa »

I got it to work without using PDO and changing my tns a bit.

Most likely there is something wrong with my Oracle client.
Post Reply