Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 - mod_php - OCI8 Problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
JATMAN
Tux's lil' helper
Tux's lil' helper


Joined: 08 Aug 2002
Posts: 85
Location: Delaware, USA

PostPosted: Fri Oct 31, 2003 10:23 pm    Post subject: Apache2 - mod_php - OCI8 Problem Reply with quote

I have been running a small server with Apache2, mod_php and OCI8 which I've been using to experiment with building PHP applications that access Oracle databases. All was well until last night when I checked for software updates, saw that one was available for apache, and emerged it. When this had finished, apache seemed to work okay and so did php - but I no longer could make Oracle connections using OCI8.

I successfully ran phpinfo() and verified that it reported that OCI8 was available (and that PHP was available). Not being much of an expert at this, I'm now lost. I know that the apache upgrade moved the Document Root to /var/www/localhost/htdocs.

When I attempt to make a connection through PHP via OCI8 now, I get something like the following:

    Warning: ocilogon(): _oci_open_server: Error while trying to retrieve text for error ORA-12154 in /var/www/localhost/htdocs/oratest.php on line 3

    Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in /var/www/localhost/htdocs/oratest.php on line 7

    Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in /var/www/localhost/htdocs/oratest.php on line 8

    Warning: ocifetchstatement(): supplied argument is not a valid OCI8-Statement resource in /var/www/localhost/htdocs/oratest.php on line 10


The OCI8 section of the display from phpinfo() shows:

Code:
oci8
OCI8 Support    enabled
Revision    $Revision: 1.183.2.5 $
Oracle Version    9.2
Compile-time ORACLE_HOME    /ora1/ora920
Libraries Used    no value



I'm not sure if the "no value" for Libraries Used is a problem.

Anyone have any ideas?
Back to top
View user's profile Send private message
sardanap
n00b
n00b


Joined: 04 Nov 2003
Posts: 5

PostPosted: Tue Nov 04, 2003 9:44 am    Post subject: Reply with quote

seems that there is some problem in php_src_compile from /usr/portage/eclass/php.eclass, i need php+oracle+apache too. I'm tryin' to modify php.eclass. When i will reach (hope so) a working status, i will post

Ciao

Matteo
Back to top
View user's profile Send private message
JATMAN
Tux's lil' helper
Tux's lil' helper


Joined: 08 Aug 2002
Posts: 85
Location: Delaware, USA

PostPosted: Tue Nov 04, 2003 10:26 pm    Post subject: Reply with quote

Thanks.

It's at least good to know someone else has observed the same problem I'm seeing. I was afraid that I had missed some configuration bit that was keeping this from working.

Please do post your findings if you get this working. This problem is definitely causing me some heartburn...
Back to top
View user's profile Send private message
sardanap
n00b
n00b


Joined: 04 Nov 2003
Posts: 5

PostPosted: Wed Nov 05, 2003 5:22 pm    Post subject: Reply with quote

After i lost 3 days about all possible combination of tests i submitted a bug report

https://bugs.gentoo.org/show_bug.cgi?id=32799

Matteo
Back to top
View user's profile Send private message
sardanap
n00b
n00b


Joined: 04 Nov 2003
Posts: 5

PostPosted: Thu Nov 06, 2003 9:38 am    Post subject: Reply with quote

SOOOOLVEEEEEEEEEEEEEEEEEEEEEEEEEEEDDDDDDDDDD

Apply this little patch to /etc/init.d/apache2 and you will have FULL WORKING oracle+php+apache2

Code:

diff -u apache2.orig apache2
--- apache2.orig        2003-11-06 10:36:52.000000000 +0100
+++ apache2     2003-11-06 10:52:41.000000000 +0100
@@ -3,6 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.40/apache2.initd,v
 1.13 2003/10/31 07:17:45 rajiv Exp $
 
+ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
+ORACLE_HOME=$ORACLE_BASE/product/9.2.0.1.0; export ORACLE_HOME
+LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
+PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
+
 opts="${opts} reload"
 
 depend() {
@@ -14,7 +19,7 @@
 start() {
        ebegin "Starting apache2"
        [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache
-       env -i PATH=$PATH /sbin/start-stop-daemon --quiet \
+       /sbin/start-stop-daemon --quiet \
                --start --startas /usr/sbin/apache2 \
                --pidfile /var/run/apache2.pid -- -k start ${APACHE2_OPTS}
        eend $?


Change your ORACLE_HOME to reflect your installation


Ciao Ciao


Matteo


P.S. Italians do it better :-)
Back to top
View user's profile Send private message
JATMAN
Tux's lil' helper
Tux's lil' helper


Joined: 08 Aug 2002
Posts: 85
Location: Delaware, USA

PostPosted: Thu Nov 06, 2003 4:27 pm    Post subject: Reply with quote

Thanks!!!

I'll give that a try this evening. Still seems like a bug in the latest apache ebuild since previous versions detected the Oracle environment of the session the emerge occured in and applied it whereever necessary. Regardless, I'm happy that I can work around it with your patch.

I guess Italians really do do it better!

JATMAN
_________________
Tyan (S2932)
Dual Opteron 2344HE quad-core processors
8GB RAM
Four 500GB SATA-II drives (7200 RPM) - RAID 0
3ware 9650SE controller
Back to top
View user's profile Send private message
JATMAN
Tux's lil' helper
Tux's lil' helper


Joined: 08 Aug 2002
Posts: 85
Location: Delaware, USA

PostPosted: Fri Nov 07, 2003 1:17 am    Post subject: Reply with quote

Matteo:

Just wanted to followup and confirm that I did make the patch you described and it did restore OCI8 operation on my server. Thank you very much for your help.

John
_________________
Tyan (S2932)
Dual Opteron 2344HE quad-core processors
8GB RAM
Four 500GB SATA-II drives (7200 RPM) - RAID 0
3ware 9650SE controller
Back to top
View user's profile Send private message
Antonio
n00b
n00b


Joined: 07 Mar 2003
Posts: 35
Location: Manaus, AM - Brasil

PostPosted: Mon Dec 22, 2003 9:57 pm    Post subject: Reply with quote

sardanap wrote:
After i lost 3 days about all possible combination of tests i submitted a bug report

https://bugs.gentoo.org/show_bug.cgi?id=32799

Matteo


I had the same problem, I have to dig some time too... just to easy the things see this bug:

[edit]
https://bugs.gentoo.org/show_bug.cgi?id=32364
Thanks Tangent for the right link
[/edit]

"To fix: change "env -i" to "env -i ORACLE_HOME=$ORACLE_HOME" (in the /etc/init.d/apache2) if the "oci8" use flag is enabled."

hope this save some time...

anTONIo


Last edited by Antonio on Tue Dec 23, 2003 1:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
tangent
n00b
n00b


Joined: 13 Apr 2003
Posts: 11

PostPosted: Tue Dec 23, 2003 3:48 am    Post subject: Reply with quote

Quote:
I had the same problem, I have to dig some time too... just to easy the things see this bug:

https://bugs.gentoo.org/show_bug.cgi?id=32324

"To fix: change "env -i" to "env -i ORACLE_HOME=$ORACLE_HOME" (in the /etc/init.d/apache2) if the "oci8" use flag is enabled."

hope this save some time...

The correct link is https://bugs.gentoo.org/show_bug.cgi?id=32364
Back to top
View user's profile Send private message
gcombe74
n00b
n00b


Joined: 27 Jan 2004
Posts: 47
Location: Ogden Utah

PostPosted: Mon Jul 26, 2004 9:28 pm    Post subject: php and oracle setup Reply with quote

Is there a apache2 - php and oracle setup guide for gentoo? I have searched but I did not get any results.

Thanks
_________________
Gentoo Linux go with the best ---- and forget the rest!
Back to top
View user's profile Send private message
Antonio
n00b
n00b


Joined: 07 Mar 2003
Posts: 35
Location: Manaus, AM - Brasil

PostPosted: Mon Jul 26, 2004 10:23 pm    Post subject: Re: php and oracle setup Reply with quote

gcombe74 wrote:
Is there a apache2 - php and oracle setup guide for gentoo? I have searched but I did not get any results.

Thanks


Some time ago I used this thread to get OCI working with PHP/APACHE and this https://forums.gentoo.org/viewtopic.php?t=106527

to make ORACLE work on gentoo...

Just a start point...

hope this helps,

anTONIo
Back to top
View user's profile Send private message
gcombe74
n00b
n00b


Joined: 27 Jan 2004
Posts: 47
Location: Ogden Utah

PostPosted: Thu Jul 29, 2004 3:10 pm    Post subject: Reply with quote

Thanks...

any and all help is appreicated. I just did not know how to attempt this on gentoo since it seems the package maintainers are modulizing all the things for apache on this distro.

thanks
_________________
Gentoo Linux go with the best ---- and forget the rest!
Back to top
View user's profile Send private message
kumy
n00b
n00b


Joined: 05 Apr 2005
Posts: 10
Location: Avignon

PostPosted: Tue Jul 26, 2005 1:35 pm    Post subject: Reply with quote

Quote:
I had the same problem, I have to dig some time too... just to easy the things see this bug:

https://bugs.gentoo.org/show_bug.cgi?id=32324

"To fix: change "env -i" to "env -i ORACLE_HOME=$ORACLE_HOME" (in the /etc/init.d/apache2) if the "oci8" use flag is enabled."

hope this save some time..
.

Works great for me too...
Back to top
View user's profile Send private message
dussel
n00b
n00b


Joined: 26 Sep 2005
Posts: 38
Location: At the moment Hamburg

PostPosted: Wed Sep 28, 2005 3:01 pm    Post subject: Still have a problem with Apache2 and Oracle Reply with quote

Hi,

I'm not sure is this bug already fixed (this thread starts Oct 2003), but I 've now exactly the problem that was here descriped.

I tried all the hints, changing the things like sardanap did it. Also I tried the way with changing the

Quote:
"To fix: change "env -i" to "env -i ORACLE_HOME=$ORACLE_HOME" (in the /etc/init.d/apache2) if the "oci8" use flag is enabled."


But it doesnt work for me. Maybe someone could look over my code, I still trying to did it like this(second) way:

out of /etc/init.d/apache2
Code:

APACHE2="env -i ORACLE_HOME=$ORACLE_HOME /usr/sbin/apache2"

# orginal   APACHE2="env -i ${OLDENV} /usr/sbin/apache2"


I export the
Code:

export ORACLE_BASE=/usr/lib/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TNS_ADMIN=/root

in the /etc/profile

Any suggestions?

Kind regards

Dussel
Back to top
View user's profile Send private message
kumy
n00b
n00b


Joined: 05 Apr 2005
Posts: 10
Location: Avignon

PostPosted: Wed Sep 28, 2005 3:10 pm    Post subject: Reply with quote

after emerging a new version of apache, I had to change things like this

in /etc/init.d/apache2

Code:
APACHE2="env -i ORACLE_HOME=/home/oracle/app/product ${OLDENV} /usr/sbin/apache2"


of course, adjust the ORACLE_HOME path to fit your needs...

Regards
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum