| View previous topic :: View next topic |
| Author |
Message |
JATMAN Tux's lil' helper


Joined: 08 Aug 2002 Posts: 85 Location: Delaware, USA
|
Posted: Fri Oct 31, 2003 10:23 pm Post subject: Apache2 - mod_php - OCI8 Problem |
|
|
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 |
|
 |
sardanap n00b

Joined: 04 Nov 2003 Posts: 5
|
Posted: Tue Nov 04, 2003 9:44 am Post subject: |
|
|
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 |
|
 |
JATMAN Tux's lil' helper


Joined: 08 Aug 2002 Posts: 85 Location: Delaware, USA
|
Posted: Tue Nov 04, 2003 10:26 pm Post subject: |
|
|
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 |
|
 |
sardanap n00b

Joined: 04 Nov 2003 Posts: 5
|
|
| Back to top |
|
 |
sardanap n00b

Joined: 04 Nov 2003 Posts: 5
|
Posted: Thu Nov 06, 2003 9:38 am Post subject: |
|
|
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 |
|
 |
JATMAN Tux's lil' helper


Joined: 08 Aug 2002 Posts: 85 Location: Delaware, USA
|
Posted: Thu Nov 06, 2003 4:27 pm Post subject: |
|
|
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 |
|
 |
JATMAN Tux's lil' helper


Joined: 08 Aug 2002 Posts: 85 Location: Delaware, USA
|
Posted: Fri Nov 07, 2003 1:17 am Post subject: |
|
|
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 |
|
 |
Antonio n00b


Joined: 07 Mar 2003 Posts: 35 Location: Manaus, AM - Brasil
|
Posted: Mon Dec 22, 2003 9:57 pm Post subject: |
|
|
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 |
|
 |
tangent n00b

Joined: 13 Apr 2003 Posts: 11
|
|
| Back to top |
|
 |
gcombe74 n00b


Joined: 27 Jan 2004 Posts: 47 Location: Ogden Utah
|
Posted: Mon Jul 26, 2004 9:28 pm Post subject: php and oracle setup |
|
|
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 |
|
 |
Antonio n00b


Joined: 07 Mar 2003 Posts: 35 Location: Manaus, AM - Brasil
|
Posted: Mon Jul 26, 2004 10:23 pm Post subject: Re: php and oracle setup |
|
|
| 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 |
|
 |
gcombe74 n00b


Joined: 27 Jan 2004 Posts: 47 Location: Ogden Utah
|
Posted: Thu Jul 29, 2004 3:10 pm Post subject: |
|
|
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 |
|
 |
kumy n00b

Joined: 05 Apr 2005 Posts: 10 Location: Avignon
|
Posted: Tue Jul 26, 2005 1:35 pm Post subject: |
|
|
| 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 |
|
 |
dussel n00b


Joined: 26 Sep 2005 Posts: 38 Location: At the moment Hamburg
|
Posted: Wed Sep 28, 2005 3:01 pm Post subject: Still have a problem with Apache2 and Oracle |
|
|
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 |
|
 |
kumy n00b

Joined: 05 Apr 2005 Posts: 10 Location: Avignon
|
Posted: Wed Sep 28, 2005 3:10 pm Post subject: |
|
|
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 |
|
 |
|