Xampp & Oracle

Step by Step procedure to Configure Xampp & Oracle 9i

Install Oracle9i on a Remote Server (Installation of oracle 9i)
Install XAMPP for windows version 1.6.8 (Installation of Xampp for windows is discussed here)
Install Oracle Client 10g

Using oci module for connecting PHP & Oracle
Edit php.ini file, the path to this file is shown in phpinfo page under Loaded Configuration File
Uncomment the line shown below..

;extension=php_oci8.dll
(just remove the semicolon to uncomment the line)
Save the file
Restart Apache Tomcat
Check the phpinfo page, If all goes good u should be able to see the oci details under OCI8

Connect to your database using the php code as shown below

// try connecting to the database
$conn = oci_connect(’scott’,

‘tiger’,'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.136.7.8)(PORT=1521))

(CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME = oracle9.itiltd.com)))’);
// check for any errors
if (!$conn)
{
$e = oci_error();
print htmlentities($e['message']);
exit;
}

// else there weren’t any errors
else
{
echo ‘Connection To Oracle DB Success.’;
}

?>

REMARKS: I’ve tried erlier with Oracle Client 9i. It didn’t workout & was showing error as unable to find php_oci.dll in apache error logs, so i switched to Oracle Client 10g & its working fine.

0 comments:

Post a Comment