Operating System - HP-UX
1823958 Members
3654 Online
109667 Solutions
New Discussion юеВ

Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

 
SOLVED
Go to solution
Alex Green
Frequent Advisor

Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Hi,

I've installed the Apache 2.0 Package from HP on a system already running Oracle 9iR2. I'm trying to get the test oracle.php page to connect, put after changing the values, the page reports the following error "Fatal error: Call to undefined function: ocilogon() in /opt/hpapache2/htdocs/oracle.php on line 29",

Is this because OCI8 is not supported in the included PHP or what?

Thanks in advance,
Alex
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
10 REPLIES 10
benoit Bruckert
Honored Contributor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Hi Alex,
I'm not sure but i think that php support isn't included in Apache from php, and if it's included, then OCI8 is another option from PHP, and with this option you have to specify the path to Your oracle_home .
The best way to make it work is to compile both php and Apache with your own path !
hope that help.
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Alex Green
Frequent Advisor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

I tried compling apache from source, but the httpd is not executable, and when I try to build PHP from source, and tell it to use the apxs2 from the HP Bundle it says "use apxs for 1.3.x support", even when i am using apache 2.0.39.

Can anyone help me?

Thanks Again,
Alex
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
benoit Bruckert
Honored Contributor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

On my side, I never succeed to make http work with apxs, I always used the static mode.
Did you try it ?
in the INSTALL file from PHP sources, it explains the way to compile apache+php in static mode.
On my side I didn't try to compile Apache2... but 1.3.... can be compiled very easily (gcc way), and with all the selected feature I want with PHP..... But by the static way (PHP is included is the httpd file !)
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
benoit Bruckert
Honored Contributor
Solution

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Ok,
I will have one day to upgrade to apache 2.. and PHP, so I studied the way to make it work.
The steps to follow to compile PHP 4.2.1 + Apache 2.0.39 are those :
0 - PHSS_22514 or better should be installed
1 - gcc : I used this one to make it work ! version 2.95.2
2 - Apache :
- downlaod apache2.0.39 source tar gunziped,
#gunzip
#tar -xf
then in httpd-2.0.39 directory, run :
#./configure --prefix= --enable-module=so
#make
#make install (as root).

3 - php :
download php sources ,
#gunzip
#tar -xf php.tar
#cd php source dir
At this level it's less easy ! :
#cd sapi/apache2filter
edit php_functions.c
change MODULE_MAGIC_AT_LEAST to AP_MODULE_MAGIC_AT_LEAST
#cd ../..
#cd main
edit reentrancy.c
If you have an smp system :
add "&& !defined(PHP_HPUX_TIME_R)"
at the end of these 4 lines :
#if !defined(HAVE_LOCAL_TIME_R) && (defined(HAVE_LOCALTIME)
#if !defined(HAVE_CTIME_R) && (defined(HAVE_CTIME)
#if !defined(HAVE_ASCTIME_R) && (defined(HAVE_ASCTIME)
#if !defined(HAVE_GMTIME_R) && (defined(HAVE_GMTIME)

change the functions c_time_r :
if (ctime_r(clock, buf, 26) != -1)
to
if (ctime_r(clock, buf) != -1)
(2 times in this source file)
Do the same with asctime_r :
if (asctime_r(tm, buf, 26) != -1)
to
if (asctime_r(tm, buf) != -1)
(2 times also).
save your changes in this file,
go back to the main dir:
#cd ..
run the configure script :
#./configure --prefix= --with-oci8= --with-apxs2=/bin/apxs --enable-track-vars
#make
#make install
You may have an error at this level, if so then :
#make install -i
The next time directory will be created, then make install alone will be ok.
#./libtool --finish /libs
It's not the end,
you have to edit httpd.conf,
Add the line :
AddType application/x-httpd-php .php
The load module line had been added by the make install.
And last but not least,
before starting apache :
define : #LD_PRELOAD="/usr/lib/libcl.2"
#export LD_PRELOAD
start Apache :
/bin/apachectl start
It should be ok !!

Nota :
Don't forget to change in httpd.conf the user and group !!!

For me it works fine so it should be the same for you.
All these informations were found on the net or man...

Hope it will work for you !!
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
benoit Bruckert
Honored Contributor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Last remark :
ITs writen in readme file of PHP, that the support to apache2 is experimental and shouldn't be used in production servers !

by.
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Alex Green
Frequent Advisor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Well, sending a huge thanks to benoit for all the help.

I'll give it a whirl.

I'll let you know if it doesn't work :).

Thanks again
Alex
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
patricktnk
New Member

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Hi benoit,
I've successfully compile php 4.2.2 as shared library with apache2 and mysql enabled.
I've change line 534 and 535 in sapi_apache2.c to
ap_register_output_filter("PHP", php_output_filter, NULL, AP_FTYPE_RESOURSE)
ap_register_input_filter("PHP", php_input_filter, NULL, AP_FTYPE_RESOURSE

and finally successful compile it.

But when I restart apache, terrible thing happe
n:

# ./apachectl start
Syntax error on line 230 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp4.so into server: Unresolved symbol: __umoddi3 (code) from /usr/local/mysql/lib/mysql/libmysqlclient.sl.10

what I've to do???
kwalther
New Member

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

I am having the same problems connecting to Oracle 9i for linux in a development environment on Redhat 7.3 with the latest Apache and Php builds. I have tried the above changes and ocilogin() still gives me an error. If I were using mysql database I might have better luck, but that's not the db I'm developing on. So, I've decided to try a static install using Apache 1.3.27 with the latest Php build. I'll post if this attempt fails too.
Analyst
benoit Bruckert
Honored Contributor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

Hi Patricktnk,
If you are still alive, may be I could give some answers...
I didn't activate the email notification on this thread, and didn't know that you post something on it !
The trouble you have seems to be linked with mysql, not with php or apache.
How did you install mysqlclient ??
Are you sure you have the proper release for your OS ?
Try mysql on a command line to see if you can connect to any database !

regards
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Steven E. Protter
Exalted Contributor

Re: Apache 2.0.39 + PHP4 + Oracle 9i + OCI8

You need to visit metalink.oracle.com

You may have a problem running Oracle 9i and Apache 2.0 on the same system.

Since 8i the standard oracle install includes an apache installation. It is possible to bypass it, and I've never let it try and install on a system that already has apache. In the 8i world, it wants port 80 and was quite happy to clobber an existing apache installation.

HP-UX 11.11(11i) includes a default apache installation. I have just finished installing ias 1.0.2.2 which includes oracle http, which is an apache port.

I have managed to do so without impacting the pre-installed apache that came with the OS. The good news is these are both apache 1.3.x servers. The HP installation is on port 80, the ias one is on port 7777.

If the oracle http server(apache 1.3.x) is not certifed to run on the same box as an apache 2.0 server, all kinds of troulbe can come up.

Good luck.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com