fbpx

Installing Oracle in WAMP environment

Installing Oracle in WAMP environment

Installing Oracle in WAMP environment
Download Oracle Express Edition (Free download) from the link.
Download Oracle SQL Developer which is a free download too from the link below:
If you dont have any experience working with Oracle SQL Developer, you can read this article
Install wamp server 2.5
enable php_oci8.dll extension in php modules
You need to download “Instant Client Downloads for Microsoft Windows (32-bit)“. Download Version 11.2.0.4.0 Instant Client Package from the link above.
Place the files in any directory eg: C:\WampDeveloper\Tools\Oracle\instantclient_11_2
Then modify the System’s PATH environmental variable with the end location. This is important as otherwise its DLLs (OCI.dll) will not be found/loaded by PHP’s php_oci8_11g.dll: C:\WampDeveloper\Tools\Oracle\instantclient_11_2
Restart the wamp server.
Try this in any php code file for testing of oracle & php database connection.

if ($conn = oci_connect('hr', 'hr', '//localhost/xe'))
{
    //print 'Successfully connected to Oracle Database!';
}
else
{
    $errmsg = oci_error();
    print 'Oracle connection failed, Please check username, password and service name in oci_connect: ' . $errmsg['message'];
}

You can use hostname “//localhost/xe” or “(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=xe)))” in the connection statement.
I had an inspiration from this article
 

Share this post