Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: PHP/Oracle home problem ?

Re: PHP/Oracle home problem ?

From: Mladen Gogala <>
Date: Fri, 31 Aug 2007 04:36:38 -0400
Message-ID: <>

In article <>, says...
> Hello all, I have what I thought was a PHP problem but I think it is
> an Oracle setup and configuration problem with PHP. I know this is an
> Oracle group but I have had no luck in the PHP groups and Mladen
> Gogala is Oracle and PHP so I am trying to get help posting here. I
> have read the charter and if I am violating it I apologize in
> advance.

OK, let's see

> Here is my configuration
> jason_at_home:~$
> jason_at_home:~$ free
> total used free shared buffers
> cached
> Mem: 3075856 866608 2209248 0 12532
> 668632
> -/+ buffers/cache: 185444 2890412
> Swap: 578300 0 578300
> jason_at_home:~$ uname -a
> Linux home 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686
> GNU/Linux

This is an unofficial build. My FC7 has kernel 2.6.22, the official RH 4.0 kernel version is much lower:
[oracle_at_oracle12 install]$ uname -a
Linux oracle12 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux
[oracle_at_oracle12 install]$
[oracle_at_oracle12 install]$ cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

You are probably using something like CentOS 5. In case of an unofficial build, setup must be checked very carefully. On the other side, I didn't have any trouble with installing 11g on my FC7.

> Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.
> There is something wrong with your system - please check that
> ORACLE_HOME is set and points to the right directory in /var/www/
> testoci.php on line 4
> Logon OK

Oracle 11g doesn't protect $ORACLE_HOME the way 10g used to do. The script, used by 10g to to remove that protection, is now gone. The script used to be named $ORACLE_HOME/install/ It is, however, likely that there is some problem with file protection. Unfortunately, you will have to use "strace -af -e trace=file" to find out what that is.

> I don't understand it. In my Apache startup script, I have added echo
> $ORACLE_HOME >/1.lst. When I reboot the computer, and examine this
> file, it shows /oracle/test11g which is my Oracle home.

You should also add LD_LIBRARY_PATH. Add the following in the /etc/init.d/httpd:
export ORACLE_HOME=/ORACLE/app/oracle/product/11g export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Make sure that this is added before the call to apachectl. Received on Fri Aug 31 2007 - 03:36:38 CDT

Original text of this message