100% found this document useful (1 vote)
2K views

Steps On How To Connect To Oracle Database 11g by Using Xampp

This document provides a 7-step process for connecting an Oracle Database 11g to XAMPP. The steps include installing XAMPP with PHP 5.2 or higher, uncommenting the php_oci8_11g extension in the php.ini file, checking that the OCI8 extension is enabled in phpinfo.php, and creating a test PHP page called dbconn.php to connect to the Oracle database and verify the connection. A sample dbconn.php file is provided to test the connection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

Steps On How To Connect To Oracle Database 11g by Using Xampp

This document provides a 7-step process for connecting an Oracle Database 11g to XAMPP. The steps include installing XAMPP with PHP 5.2 or higher, uncommenting the php_oci8_11g extension in the php.ini file, checking that the OCI8 extension is enabled in phpinfo.php, and creating a test PHP page called dbconn.php to connect to the Oracle database and verify the connection. A sample dbconn.php file is provided to test the connection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

STEPS ON HOW TO CONNECT TO ORACLE DATABASE 11g BY USING XAMPP

Prepared by: Muhammad Shakirin Bin Samin


Note: This tutorial has been tested by using XAMPP v3.3.2 and Oracle Database 11g Express Edition

1. Please make sure that youve installed XAMPP with PHP5.2 and above (recommended using
XAMPP with PHP5.5 or PHP5.6). Otherwise, download it at
https://www.apachefriends.org/download.html

2. Open XAMPPs PHP configuration file at C:\xampp\php\php.ini by using Notepad or other


text-editor.

3. Find extension line. | ;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client |
(it might be at line 1008). Then, uncomment the extension by remove the semicolon before
the extension word.

4. Save and close the php.ini configuration file. Now, you may run your XAMPP Control Panel.
Start the Apache service.

5. Open page http://localhost/dashboard/phpinfo.php to check if OCI8 extension is enabled. If


you cant find oci8, try to Stop and Start your Apache. Then, refresh the page.

6. Now, you can create a PHP page to test your Oracle 11g database connection. Below is a
sample of PHP code.
Filename: dbconn.php
<?php

/* php & Oracle DB connection file */


$user = "hr"; //Oracle username
$pass = "system"; //Oracle password
$host = "localhost/XE"; //server name or ip address
$dbconn = oci_connect($user, $pass, $host);
if(!$dbconn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES),
E_USER_ERROR);
} else {
echo "ORACLE DATABASE CONNECTED SUCCESSFULLY!!!"; //you
can remove this
}

?>

7. Run the test page on your browser.

<| The End! |>

You might also like