Web Hosting Talk







View Full Version : Oracle9i + Windows 2000 Server + PHP


almahdi
08-09-2005, 05:53 AM
I've been trying to connect to an Oracle server via PHP but it doesn't work..

Here is an explanation of the problem:
Server is running on Windows 2000 Server, PHP over IIS.

I am trying to connect to a remote Oracle Server using odbc... it seems to connect to the microsoft driver instead of the oracle one i want to use and configured.

$conn=@odbc_connect("orasrv","user","pass");
if ($conn) {
echo "Successfully connected to Oracle.\n";
}
else echo "Error Connecting<br>";

if (@odbc_error())
{
echo odbc_errormsg();
}
else
{
echo "Successfully connected to Oracle.\n";
}


I wish if anyone could help me in writing an ODBC connection string.

Burhan
08-09-2005, 07:00 AM
Is there any reason why you are not using the Oracle Extension (http://www.php.net/manual/en/ref.oci8.php)?

almahdi
08-09-2005, 08:40 AM
I've been trying to use it, but unfortunately it didn't work too.


$conn=@ocilogon("user","pass","orasrv");
if ($conn) {
echo "Successfully connected to Oracle.\n";
}
else echo "Error Connecting\n";


I've tried this code, but it always come back with an Error saying:
ocilogon(): _oci_open_server:Error while trying to retreive text for error ORA-12154.

so that I thought of using ODBC but it didn't work too.