php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25688 Connect To Oracle 9i using IIS & PHP
Submitted: 2003-09-29 08:25 UTC Modified: 2003-09-30 05:32 UTC
From: ramez at faraah dot com dot sa Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.3.3 OS: Win XP
Private report: No CVE-ID: None
 [2003-09-29 08:25 UTC] ramez at faraah dot com dot sa
Description:
------------
Hello I am using Oracle9i release 2
it's comes with Apache
but i am using IIS and i don't want to use Apache.

how can i connect to Oracle DB from the IIS using PHP
i try to use 
=================
user:scott
Password:tiger
Service:RamezDB
=================
how can i do ti

Reproduce code:
---------------
<HTML>
<HEAD>
<TITLE>Using PHP to Read a Table in Oracle</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER><B>Employees</B>
<BR><BR>
<?php

$c1 = ocilogon("scott","tiger") or print("<br>Could not connet to Oracle9i<br>");

$stmt = ociparse($c1," select * from emp");
  ociexecute($stmt,OCI_DEFAULT);
  echo $c1."----selecting\n\n";
  while (ocifetch($stmt))
    echo $c1." <".ociresult($stmt,"TEST").">\n\n";
  echo $c1."----done\n\n";

Expected result:
----------------
to reterive the data from Oracle9i

Actual result:
--------------
Warning: _oci_open_server: ORA-12560: TNS:protocol adapter error in c:\inetpub\wwwroot\oracle\test.php on line 10

Could not connet to Oracle9i

Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in c:\inetpub\wwwroot\oracle\test.php on line 13

Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in c:\inetpub\wwwroot\oracle\test.php on line 14
----selecting 
Warning: ocifetch(): supplied argument is not a valid OCI8-Statement resource in c:\inetpub\wwwroot\oracle\test.php on line 16
----done 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-29 08:29 UTC] sniper@php.net
And try searching for ORA-12560 with Google for example..

 [2003-09-30 05:25 UTC] ramez at faraah dot com dot sa
i found the solution
 i should write the Service name In The Connection Function
==============================================
$c1 = ocilogon("scott","tiger","RamezDB") or print("<br>Could not connet to
Oracle9i<br>");
==============================================
thanks for your help
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 16:01:29 2024 UTC