Downloading Dependencies
- Download Oracle 11g here. (CLICK THE IMAGE IF ITS TOO BLUR FOR YOU)
- Download XAMPP 1.7.4 here.
- Download Oracle Instant Client here.
- Download Oracle OCI 8 for the module here.
- Choose the 7.2 Thread Safe x86
Steps:
- Install the Oracle, follow the instruction on how to install those downloaded 2 ZIP files.
- Make sure you remember the password you key-in during installation.
- Install XAMPP as usual.
- Extract the Oracle OCI 8 and copy file name 'php_oci8_11g.dll' to [C:\xampp\php\ext], override any existing files in that folder.
- Edit php.ini at [C:\xampp\php\php.ini], add more line for extension.
- Extract Oracle Instant Oracle; first make folder name Oracle at C: drive, then point the environment variable to the folder oracle [C:\oracle\instantclient_12_2].
- Restart XAMPP.
- Create connect.php file with content below,
<?php $conn = oci_connect("username", "password", "//localhost/orcl"); // Create connection to Oracle if (!$conn) { $m = oci_error(); echo $m['message'], "\n"; exit; } else { print "Connected to Oracle!"; } // Close the Oracle connection oci_close($conn); ?>
. - Successfully connected .
- You can also check in the info.php for the OCI module has been loaded
<?php phpinfo(); phpinfo(INFO_MODULES); ?>
.
0 comments:
Post a Comment