473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Oracle connection problem: PHP, IIS, and OCI8

Hi,

We're having problems connecting to an Oracle 9i db using PHP 5.2.1 and OCI8. Also, we are using IIS 5.1.

PHP is working--we can see the info.php page. On the info.php page I see that OCI8 is enabled.

But a simple page with an Oracle connection like this returns only 'hello' from the print statement and then nothing:

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<?php print("hello"); ?>
<?php
$conn = OCILogon([user], [pwd], [tnsnames entry]);
$query = 'select table_name from user_tables';
$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
OCILogoff($conn);
?>
</body>
</html>

The path seems correct. The first entry is the PHP directory and the 2nd entry is the Oracle directory where the OCI .dlls reside.

The same login/pwd@tns_entry can be accessed through sqlplus located in the same directory as the OCI .dlls.

Any help will be greatly appreciated.
Mar 15 '07 #1
1 5599
OK, the problem was with our Oracle client setup. The TNSNames.Ora file that we were using had entries that ended with '.world'. We were originally using Oracle's instant client which doesn't have a sqlnet.ora configuration file. We installed the standard Oracle 10g client instead and configured the sqlnet.ora file so that it included this line:
NAMES.DEFAULT_DOMAIN = WORLD

Surprisingly to me, sqlplus worked when we had the instant client installed even though the OCI dlls used by PHP did not.

I believe the instant client can be made to work as well even with the '.world' entries by adding some configuration information to the tnsnames.ora file. But I have not tried this out.

I hope this is helpful to somebody.
Mar 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Geoff Muldoon | last post by:
Hi all, Help please. Environment: Unix (Tru64) / Apache / PHP4.0.6 / Oracle8i Establish connection to Oracle: for ($I=0; $I<$max_attempts; $I++) {
3
by: Chad The Man | last post by:
I have been developing some applications on suse 9 / apache 1.37 / php 4.3.4 / Oracle 9i / OCI8. We recently moved servers, apache works fine, php works fine, oracle works fine... however, trying...
2
by: jayPLEASEtylerNOwilliamsSPAM | last post by:
Hi, I set up PHP 4.xx using Apache 1.3 on Windows XP to begin a project. The project now needs to be moved to a real test box. Admittedly, I am not quite sure how I was able to access Oracle on my...
3
by: David | last post by:
Hello all, I have been trying to use the OCI driver to connect to Oracle 9i, but have been getting the following error: java.sql.SQLException: Closed Connection at...
6
by: DravenStone | last post by:
Hi, I had just a horrible day at work, spent pretty much the entire day trying to get php_oci.dll and php_oracle.dll to load. It still never did. Super Quick Background. Jack of all trades IT...
9
by: Keith E. Sauvant | last post by:
Hi, we got a strange problem connecting to an Oracle database onsite with our PHP application: During CSV import job handled by our application, PHP opens up to some hundred connections to the...
6
by: hegyvari | last post by:
Hi, I have a few apps written in PHP, running on Fedora Core. After porting these applications from PostgreSQL to Oracle a bug appeared: sometimes, not in a reproducable manner, the web page...
1
by: burtonl | last post by:
I'm using the ADODB abstraction layer and trying to figure out how to call an Oracle stored procedure. It has the following types defined: CREATE OR REPLACE TYPE varchar2_3200_array IS TABLE...
0
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.