473,779 Members | 2,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OCILogon Fails But OCIError Returns False.

37 New Member
Hello,

I am writing a simple PHP script to see if I can make a connection to my Oracle database. And it showed that my call to OCILogon() failed. But
my call to OCIError() returned "False", which I believe meant to be "no
error found".

I wonder if you could please help me get additional information as to why
my call to OCILogon() failed? My code is below.

Thank you and Best Regards,

Akino
=============== =============== =============== ============

Code :
====
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. echo "Connecting...<br/>";
  3. $c = OCILogon("abc123", "abc123", "testDB");
  4. if ($c == false) {
  5.    $err = OCIError();
  6.     if ($err == false)
  7.        echo "No error found.<br/>";
  8.     else
  9.        echo "Oracle Connect Error " . $err[code] . $err[message] . "<br/>";
  10. else {
  11.    echo "Successfully connected to testDB<br/>";
  12.    OCILogoff($c);
  13. }
  14. echo "Exiting...<br/>";
  15. ?>
  16.  
Output :
=====

Connecting...
No error found.
Exiting...
Feb 20 '09 #1
1 4059
gits
5,390 Recognized Expert Moderator Expert
you might have a look here and check whether all preliminaries are fullfilled ... correct php.ini, installed oracle-client etc.

kind regards
Feb 21 '09 #2

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

Similar topics

7
11028
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++) {
1
2081
by: arun.kumar.varma | last post by:
Hi, My objective is to try to connect to the oracle database and if an error occurs go to another page. The code follows $conn = OCILogon($user,$passwd,$db); // <---- Line 34 if (!$conn) { $err = OCIError(); header("Location: dbproblem.php?error=$err");
1
5535
by: DP | last post by:
I am porting an existing application to OCI. I have 200+ client computers. Since the existing app already has a way to retrieve settings off another server I am looking to bypass tnsnames.ora. Of course I could just rewrite tnsnames before calling OCILogon, but I was hoping to be able to pass a key/value list or similar in the dbname parameter. Alternately, can OCILogon use environment variables for this? DP
2
6359
by: mike | last post by:
I've spent a couple of days on this and I'm to the "bang-my-head 'gainst the monitor and babble in tongues" mode. First - SuSE Pro 9.3, Linux 2.6.11.4-21.7, Apache 2.0.53, PHP 4.3.10 I have sendmail running on the local server - mail from unix (1) mail and mutt work locally on the server. This is, specifically, sending mail to a localhost user or another user off on the net somewhere works fine.
8
2409
by: Rick Lederman | last post by:
I am using a PrintDocument and PrintDialog to print. The first time that I print it works, but when I try to print a second time without exiting the entire program I get an "InvalidPrinterException was unhandled" error. The error happens in the third line below. The details of the error are below my signature. Help? PrintDialog1.PrinterSettings.PrinterName = sLabelPrinterDeviceName PrintDialog1.Document = PrintDocument1
2
25824
by: JuliouZ | last post by:
Warning: ocilogon() : OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /web/htdocs/test.php on line 6 Oracle Connect Error my file test.php : <?php PutEnv("ORACLE_SID=TEST"); PutEnv("ORACLE_HOME=/oracle/ora102"); PutEnv("TNS_ADMIN=/oracle/ora102/network/admin");
8
3239
by: Tyno Gendo | last post by:
I have just written a line of code like this (yes, many people think this stinks bad): <?php true == isset($page_seq) ? echo "$page_seq" : false; ?> However it breaks with 'Unexpected T_ECHO' But <?php true == isset($page_seq) ? print "$page_seq" : false; ?>
2
8418
by: rdilipk | last post by:
I am posting at the end of this post some code that P/Invoke's SetSystemTime to set the local system time. This call fails -- i.e the time is not set and the API returns false. However calling Marshal.GetLastWin32Error immediately afterwards returns an errorcode of 0 indicating that the operation somehow executed successfully. This is a plain vanilla console app written in C#. It runs on vista and has a manifest embedded in it that...
3
6634
by: ragonz | last post by:
i tried to execute php file from cmd line. i'm using xampp version 1.67 with windows server 2003 as the OS. it'll also include oracle as the database,which means OCILogon() will be called in my php file and so other functions. i already configured the php.ini so that it connects to oracle. in web page, i can access the database(oracle). But the problem is, when i tried to execute the php file through cmd line with this code : ...
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.