ocilogon() from php to oracle ...error:undefined function

Posted on 2008-11-12
Last Modified: 2013-12-19
this is a winxp apache 2.2 server, php5.2, oracle client, 8i database on sco. able to connect to oracle from sqlplus.
the connect string is the one in the tnsnames.ora is
connect.WORLD =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver)(PORT = 1521))
    (CONNECT_DATA = (SID = db)

i am getting this error:
Fatal error: Call to undefined function OCILogon() in C:\webs\test\testoracle.php5 on line 2
pls help


       if ($c=OCILogon("user", "password", "connect")) {

            echo "Successfully connected to Oracle.\n";


       } else {

            $err = OCIError();

            echo "Oracle Connect Error " . $err[text];



Open in new window

Question by:rameshupadhye

    Author Comment

    i am able to connect from this xp client to oracle on sco with the connect string in tnsnames.ora. oci8.dll is in c:\php\ext and this directory path is in php.ini but unable to see the oci8 in phpinfo().

    any help pls.. ??
    LVL 29

    Expert Comment

    by:Michael W
    Do you have the following extension enabled in the php.ini?






    Author Comment

    yes .. i mentioned it in my earlier comment. and the extension_dir is also defined as c:\php\ext in php.ini

    Author Comment

    i downloaded msvcr71.dll and tried after putting it in system32 directory.. or system directory but no improvement
    LVL 29

    Expert Comment

    by:Michael W
    In your comment you said it was placed in the c:\php\ext directory and in the path, but there is no mention that have enabled the extensions inside the php.ini:

    extension = php_oci8.dll
    extension = php_oracle.dll

    Please attach a copy of your php.ini so we can review it.

    Author Comment

    i m sorry i was not at this place..
    meanwhile, today, i have copied the php_oracle.dll in php/ext directory and enabled the same in php.ini but no result
    i m sending the php.ini..
    LVL 29

    Accepted Solution

    Well, I am out of options. Maybe one of the other EE experts have some ideas on where to look next.

    Now if you had a Linux server, I could get you up and running in no time with Apache2/PHP5/Oracle client.

    This is one of the reasons I don't recommend running Apache/PHP on Windows boxes, especially for Oracle interfaces as they are very picky and require a bit more to get working.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    php query string addition 4 23
    how to tune this sql query 61 74
    Oracle SQL Select Statement 19 42
    Reverse asset logic not working 11 26
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now