Results 1 to 8 of 8

Thread: PHP & Oracle

  1. #1
    Join Date
    Sep 2003
    Location
    ZA
    Posts
    24

    Thumbs down Unanswered: PHP & Oracle

    Morning Ladies & Gents .

    A couple of months ago i installed php without the Oracle Suport ( not intentional ) , i've been happily living using PHP & MySQL but now demands
    call that i deliver info to an Oracle DB located remotely . Tried to connect to the oracle DB only to receive the below error

    Fatal error: Call to undefined function: ocilogon()

    Riiiiggghtt .... next step . phpinfo() below .


    supported databases MySQL
    ODBC
    PostgreSQL
    Microsoft SQL Server
    FrontBase
    Oracle 8 (not really)
    Sybase-CT


    So my installation does not support Oracle , i've been googling and i cannot find any clear cut documentation for configuring the oracle support after the php installation .

    I found this @ Oracle , oracle-instantclient-basic-10.1.0.2-1.i386.rpm , but after installing that i still get the above error .

    Any help , and any pointer in the right direction would be highly appreciated.

    regards

    ronald

  2. #2
    Join Date
    Oct 2002
    Location
    Plymouth UK
    Posts
    116
    What OS, PHP version and Oracle version?

    There are two PHP extensions supporting Oracle: OCI8 and Oracle. It may be that you have the wrong one. OCILogin is a function in the OCI8 library. If you have the Oracle extension the login function is ORA_Logon.

    Things to check:
    PHP extension for Oracle support
    Oracle client is installed and working
    If Oracle client is not working check TNS entries

    I suspect your problem is probably with the Oracle extension loaded.

  3. #3
    Join Date
    Sep 2003
    Location
    ZA
    Posts
    24

    Unhappy

    Thanx for the help . This is what i have done so far .
    * Configured & Installed Apache2
    * Installed the Oracle Client
    * Configured php --with-oci8

    When i run the 'make' below is some of the errs .

    /bin/sh /home/ronald/php5/php-5.0.2/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/oci8/ -I/home/ronald/php5/php-5.0.2/ext/oci8/ -DPHP_ATOM_INC -I/home/ronald/php5/php-5.0.2/include -I/home/ronald/php5/php-5.0.2/main -I/home/ronald/php5/php-5.0.2 -I/home/ronald/php5/php-5.0.2/Zend -I/usr/include/libxml2 -I/usr/kerberos/include -I/usr/include/freetype2 -I/usr/include/mysql -I/usr/include/ncurses -I/home/ronald/php5/php-5.0.2/TSRM -g -O2 -prefer-pic -c /home/ronald/php5/php-5.0.2/ext/oci8/oci8.c -o ext/oci8/oci8.lo
    In file included from /home/ronald/php5/php-5.0.2/ext/oci8/oci8.c:71:
    /home/ronald/php5/php-5.0.2/ext/oci8/php_oci8.h:52:17: oci.h: No such file or directory
    In file included from /home/ronald/php5/php-5.0.2/ext/oci8/oci8.c:71:
    /home/ronald/php5/php-5.0.2/ext/oci8/php_oci8.h:63: parse error before "OCIServer"

    And @ the end is the ERR :

    make: *** [ext/oci8/oci8.lo] Error 1


    * Right, i then ran the Oracle Installation and installed the Oracle Development Tools and the client again but i'm still getting the above mentioned ERR's .

    From what i can see is that it's looking for an oci.h file but i cannot locate this on the box. Someone on another forum suggest installing the full blown Oracle Database Server but it does'nt seem logical to install the DB Server just too connect to a remote Ora DB Server , that and the DB server will need 1.8GB and i only have 1GB too play with .

    P2 Intel Platform
    RH9 Configured
    Apache 2 configured

    Any thoughts or documentation on the correct process to follow would be highly appreciated .

    Regards

    Ronald

  4. #4
    Join Date
    Oct 2002
    Location
    Plymouth UK
    Posts
    116
    I run PHP under IIS in a MS environment so don't really know much about the Apache setup. However, this link may be useful to help resolve your problems:

    http://bugs.php.net/bug.php?id=24950

    I think these headers are part of the PHP install, rather than the Oracle install. So it may best to start there. You certainly don't need a full database install of Oracle. I have several machines with just IIS and an Oracle client that work fine. It is only the TNS layer of the Oracle client that is used by the PHP code so installation of the database, listeners, etc wouldn't give you anything.

    Hope this is of some help.

  5. #5
    Join Date
    Sep 2003
    Location
    ZA
    Posts
    24
    Thanx for the help , i really appreciate it. Unfortunately that does'nt get me any further . Lemme google some more , who knows ...

    Thanx again

  6. #6
    Join Date
    Sep 2003
    Location
    ZA
    Posts
    24

    Guide

    You dont per chance know where i can find a detailed guide that stipulates
    what packages need to be installed to get php to work with oracle ? And in which sequence ?

    regards

    ronald

  7. #7
    Join Date
    Jul 2004
    Posts
    30
    Hi guys ..
    I have faced alot of problems in setting up the configurations between PHP and oracle couple of weeks ago .. and just today It gets started work properly.. I faced the problems with Apache2 and PHP5.. and now I'm working with Apache 1.3 and PHP 4.1.1 ..

    First u have to install the Oracle Client Application as u did.
    Then u have to go to php.ini and uncomment the following statment:
    Code:
    extension=php_oci8.dll
    (of course by removing the simecolun )


    then u have to make sure of the TNSNAMEs file's content at the following directory:
    Code:
    c:/Oracle home/ network/ admin/ TNSNAMES.ora

    and it should be look like this:

    Code:
         
    dataBase_name = 
      (DESCRIPTION = 
        (ADDRESS_LIST = 
            (ADDRESS = 
              (COMMUNITY = Check_DBA)
              (PROTOCOL = TCP)
              (Host = ORacleServer_host)
              (Port = OracleServer_port)
            )
            (ADDRESS = 
              (COMMUNITY = check_DBA)
              (PROTOCOL = TCP)
              (Host = ORacleServer_host)
              (Port = OracleServer_port)
            )
        )
        (CONNECT_DATA = (SID = ur_SID_name)
        )
      )
    and then it'll work

  8. #8
    Join Date
    Jan 2005
    Posts
    4

    problem in accessing oracle from php ,IIS6.0

    Hello,

    i am having problem to conenct oracle from php on iis6.

    please let me know your advice.

    i configured php.ini for php_oci8.dll,but still it is not conencting to oracle and does nt show the oci info on display.


    thanks in advance


    Quote Originally Posted by gannet
    I run PHP under IIS in a MS environment so don't really know much about the Apache setup. However, this link may be useful to help resolve your problems:

    http://bugs.php.net/bug.php?id=24950

    I think these headers are part of the PHP install, rather than the Oracle install. So it may best to start there. You certainly don't need a full database install of Oracle. I have several machines with just IIS and an Oracle client that work fine. It is only the TNS layer of the Oracle client that is used by the PHP code so installation of the database, listeners, etc wouldn't give you anything.

    Hope this is of some help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •