Call to undefined function ocilogon(), PHP5.2.8 - Oracle11g

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Call to undefined function ocilogon(), PHP5.2.8 - Oracle11g

Postby abajpai0906 » 07. April 2009 10:55

I am facing problem in connecting to database using PHP.
The error "Fatal error: Call to undefined function ocilogon() in C:\xampp\htdocs\ashish\x1.php", does not go at all.
Please Help me out with this, I was using oracle 10g(10.2.0) and since i was facing this issue i upgraded to Oracle 11g (11.1.0), Still i see the same error.

I am using PHP 5.2.8 (Installed with XAMPP), Oracle 11g(11.1.0).

I code i am using to connect to Oracle DB is as follows:

if ($c=OCILogon("scott", "rnd", "RND")) {
echo "Successfully connected to Oracle.\n";
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];

P.S.: In the above code RND is the database available on my local machine. UID/PWD are scott/rnd

Install Location for xampp is C:\xampp\, i changes the PHP5.ini & PHP.ini file both present in folder C:\xampp\php and in both of them i have made following changes:

also, i have kept ;extension=php_oci8.dll as disabled as mentioned in ... stant.html
The reason behind keeping ";extension=php_oci8.dll" as diabled is i tried enabling that too but the error persists even with enabling that.

My PATH is as follows:
PATH=C:\Oracle\11.1.0\db_1\bin;C:\xampp\php;C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\SFU\common;C:\Program Files\QuickTime\QTSystem;C:\Program Files\TortoiseSVN\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Common Files\Ahead\Lib\

The Worst part is none of OCI or ORA functions from PHP to Oracle DB works :(
I am doing reaserach on this error from past 10 hrs tried all possible solutions but nothing helped, kindly help me out with this, i have seen an another user mentioned the same error in this forum and was able to resolve his problem after assitance from you guys.
Thanx in advance.
Posts: 2
Joined: 07. April 2009 10:26

Re: Call to undefined function ocilogon(), PHP5.2.8 - Oracle11g

Postby abajpai0906 » 08. April 2009 06:42

Phewwwwww... Finally i was able to resolve the problem, Since i am using XAMPP, the correct PHP.ini file used by apache is located in ../xampp/apache/bin.
Genral misconception is that in XAMPP, peoplechange the PHP.ini located at ../xampp/php/php.ini, which does not have any impact on this error.

Posts: 2
Joined: 07. April 2009 10:26

Re: Call to undefined function ocilogon(), PHP5.2.8 - Oracle11g

Postby Sharley » 08. April 2009 07:11

For future reference load http://localhost/xampp/phpinfo.php and look for the line:
Loaded Configuration File

It will quickly tell you which php.ini file is loaded and it's location - and of course, all things php related in your XAMPP instance of PHP.

BTW - In the latest XAMPP for Windows 1.7.1 beta release the php.ini configuration file being loaded has been placed back in to the xampp\php\ folder location and will no longer be found in the apache\bin folder - but I assume that the changes in this upcoming release will be well publicized or the forum will fill up with support requests again.
User avatar
AF Moderator
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 50 guests