Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 13th, 2003, 05:09 AM
Registered User
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to oracle from PHP

I am trying to connect to oracle 9i using PHP. I am using ADODB for the same.
Oracle 9i
PHP 4.3.4
ADODB 4.0.3
Window 2000 Professional

I have extracted the ADODB zip file on the C Drive.

The part of the code is as follows

$db = ADONewConnection('oci8po');

$db->PConnect('','PHPUser','PHPUser','OracleServer') ;


Following are the error messages that i am getting when i execute the page.

Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in C:\adodb\adodb.inc.php on line 3197

Fatal error: Call to undefined function: ociplogon() in C:\adodb\drivers\adodb-oci8.inc.php on line 136

My oracle server is on the different machine.
I am able to connect to the server from my machine using SQLPLUS

Could somebody please help me ??

thanks and regards
Parag Joshi
Old November 13th, 2003, 10:48 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts

Okay, I've got a few questions for you:

Why are you connecting to Oracle through ADO? Have you tried accessing it via the Oracle 9 PHP extension?

Where did you get your ADODB php library from? Have you read through its documentation to figure out how you're supposed to use it?

If you're including a library file that complains about undefined constants, then my hunch is that you should be including a different file that defines all the constants needed by the library file. Well, either that or you're supposed to define all the constants yourself. Whatever the case, the answer should be in the documentation for your ADODB library.

Also, your error message suggests that you're using the Oracle 8 call interface, but you're using oracle 9. I've never used PHP with Oracle, so I can't say for sure, but you'll probably get better results by making sure all your versions match up.

Take care,

Old November 16th, 2011, 05:26 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


correct sentences "ADOdb 5"

Is better relative path

$server ="" //Server local ( or localhost) or remote server (190.168.XXX.XXX)
$db = NewADOConnection('oci8'); // For Oracle XE 8, 9 an 10 version
$db->PConnect($server,'oracleUser','oraclePassword','d atabase') ; // For Oracle 10g XE, the database is XE

The problem " OCI_COMMIT_ON_SUCCESS" is because the file php.ini en the php directory is written as ;extension=php_oci8.dll
This should be replaced by extension=php_oci8.dll wihtout ";", restart apache service and ready.

Last edited by mokanime; November 16th, 2011 at 05:28 PM.. Reason: Complementary information

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Connecting to Oracle vikasagarwal1984 ASP.NET 1.0 and 1.1 Basics 1 October 1st, 2006 01:03 PM
Connecting to Oracle with PHP atcs2152 PHP Databases 0 December 16th, 2005 08:57 AM
Connecting to Oracle without Oracle Client mahaveerar VB Databases Basics 0 February 22nd, 2005 05:18 PM
Connecting to Oracle without Oracle Client mahaveerar Excel VBA 0 February 22nd, 2005 03:55 PM
connecting to oracle amcp2002 Java Databases 2 September 20th, 2003 05:17 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.