Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > PHP & Oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-19-04, 04:52
mccrack_2003 mccrack_2003 is offline
Registered User
 
Join Date: Sep 2003
Location: ZA
Posts: 24
Thumbs down 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
Reply With Quote
  #2 (permalink)  
Old 10-22-04, 10:14
gannet gannet is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 10-25-04, 09:25
mccrack_2003 mccrack_2003 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 10-25-04, 10:17
gannet gannet is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 10-25-04, 10:45
mccrack_2003 mccrack_2003 is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 10-25-04, 11:42
mccrack_2003 mccrack_2003 is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 12-30-04, 06:27
da!sy da!sy is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 01-14-05, 05:10
sriman27 sriman27 is offline
Registered User
 
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On