AOW >> Use Oracle PHP With Wampserver Easily
cae8

Use Oracle PHP With Wampserver Easily

Use Oracle PHP with wampserver is very important. It is not soo hard to use.

Now, days Oracle is the well-known database. And use it with PHP also enhance the functionalities of PHP,  it will also impress the clients.

use oracle php with wampserver

How use the oracle PHP with Wampserver:

use Oracle with wamp, use Oracle with PHP, how to use Oracle with PHP, how integrate Oracle database with wamp, how to use oci in wamp, how install and use the instant client, configure wamp server for oci, configure wamp server for Oracle

For use the Oracle PHP with wampserver follow these instructions:

  • Visit this link: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
  • Download any latest instant client version according to your operating system OR window.
  • Extract the downloaded file in the following directories of the wamp server.
    • wamp\bin\apache\apache2.4.2\bin
    • wamp\bin\php\php5.4.3\ext
  • Open the following files in wamp directory:
    • wamp\bin\php\php5.4.3\php.ini
    • wamp\bin\apache\apache2.4.2\bin\php.ini
  • Find the following lines in the opened files:
;extension=php_mysqli.dll
;extension=php_oci8.dll      
;extension=php_oci8_11g.dll
  • And replace it with the following code/lines:
extension=php_mysqli.dll
extension=php_oci8.dll      
extension=php_oci8_11g.dll
  • Click on the wamp icon and exit it, after start it again if it not show any error it is able to work with oracle other wise you need to copy the oci.dll form the downloaded and extracted file and paste it into windows system32 directory and start the wamp server again.
  • After this download the sql developer by follow this link http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
  • After this create a new connection by only giving connection name, username, and password without changing OR disturbing other options.
  • When you create the connection you can see the table option on the left side of the sql developer window OR application.
  • Right click on the table and click new, Create table by entering the name  e.g., “USERS” and column attributes USER_ID, USERNAME, and PASSWORD.
  • Create a new php file with the following code and change the username and password in it according to the connection which you create in sql developer tool.
<?php

// Connects to the XE service (i.e. database) on the "localhost" machine
// Put the username and password which you given at time of connection creation
$conn = oci_connect('username', 'password',  'localhost/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}

$stid=oci_parse($conn, "INSERT INTO USERS (USERNAME, PASSWORD) VALUES ('Test Username', 'Test Password')");
oci_execute($stid);
$stid = oci_parse($conn, 'SELECT * FROM USERS');
oci_execute($stid);

//print_r($stid);
echo "<table border='1'>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
//print_r($row);   
   echo "<tr>\n";
    foreach ($row as $item) {
        echo "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;") . "</td>\n";
    }
    echo "</tr>\n";
}
echo "</table>\n";

?>

 

Enjoy!!!!!!!

If you need further information OR you want to discuss further things please contact us! We like to hear from you,  and we are here for your help.

Thanks!

Likes(1)Dislikes(0)
Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *


*