从PHP oci8连接到oracle数据库

从PHP oci8连接到oracle数据库

问题描述:

I'm trying to access the ORACLE database from PHP, i'm using WampServer Version 2.2 Apache 2.4.2 – PHP 5.4.3 and oracle 11g. I tried many ways including :

<?php

if ($conn = oci_connect('sys as sysdba', '12345', '//localhost/orcl'))
{
    print 'Successfully connected to Oracle Database!';     
}
else
{
     $errmsg = oci_error();
     print 'Oracle connection failed' . $errmsg['message'];
}
?>

i get the following error every time i execute:

Fatal error: Call to undefined function OCILogon() in C:\wamp\www\IDS\Index.php on line 3

Does anyone know how to solve this ??

I had to remove the ";" semicolon from the php.ini file at the oci8 line

it was like this:

;extension=php_oci8.dll

i changed it to:

extension=php_oci8.dll