Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect web service run on IIS to remote Oracle db using PHP

f326a661-8cb2-4cb0-9db3-1287fc2b7e79Feb 16 2016 — edited Feb 21 2016

I am trying to connect to a remote oracle database from an IIS machine using PHP. Starting very basic my code is

<!DOCTYPE html>

<?php

if ($conn = oci_connect(username, passowrd, server:port/instance')
{
    echo 'Successfully connected to Oracle Database!';    
}
else
{
     $errmsg = oci_error();
     echo 'Oracle connection failed' . $errmsg['message'];
}
?>

I can connect to the oracle db using sql developer and the command prompt. But every time I attempt a connection using this code I get an Http 500 error.

I can run a basic html and PHP page on the machine.

any help to start me on the proper path is great.

I have oracle instant client installed: c:\oracle\instantclient_12_1\

I have oracle PHP installed: c:\Program Files (x86)\PHP\5.6\

My website and PHP code is located at: F:\ inetpub\wwwroot\

Thanks, wil

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2016
Added on Feb 16 2016
1 comment
2,634 views