I am having trouble logging onto Oracle via PHP on a Windows 2000 machine.
I keep getting the error:
Fatal error: Call to undefined function OCILogon() in C:\Program
Files\Apache Group\Apache2\htdocs\oraconnect.php on line 15
I seem to have everything set up correctly. I am running an Oracle 9i
client and have set up the php.ini file with "extension=php_oci8.dll"
uncommented, left ";extension=php_oracle.dll" commented. (Although I have
tried various combinations of these two. Also I have set the "extension_dir
= C:\Program Files\PHP\ext" correctly and noted that php_oci8.dll and
php_oracle.dll exist there.
Now here is where it gets really weird and I could use some help:
It works fine from the command line:
I type "php oraconnect.php" for the following code:
<?php
//putenv("ORACLE_SID=TESTDB");
//putenv("ORACLE_HOME=C:/oracle/ora92");
//putenv("TNS_ADMIN=C:/oracle/ora92/network/admin");
$username = "SCOTT";
$passwd = "TIGER";
//$db="(DESCRIPTION=
// (ADDRESS_LIST=
// (ADDRESS=(PROTOCOL=TCP)
// (HOST=orahostname1)(PORT=1621)
// )
// )
// (CONNECT_DATA=(SERVICE_NAME=TESTDB))
// )";
$conn = OCILogon("SCOTT","TIGER","TESTDB");
if (!$conn)
{
echo "Connection failed";
echo "Error Message: [" . OCIError($conn) . "]";
exit;
}
else
{
echo "Connected!";
}
?>
It works either way with the env_variables in the script or with them
commented out from the command line. I just can't get it to work from the
browser.
Can anyone out there help me with this one? I have some experience with
Oracle, Perl, and a little Java but not so much with PHP.
Thanks.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php