note 61817 modified in ref.oci8 by sixd

From: Date: Thu, 10 Apr 2008 22:30:26 +0000
Subject: note 61817 modified in ref.oci8 by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-138154@lists.php.net to get a copy of this message
The error message "There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory" is somewhat deceptive in that it can be emitted even when ORACLE_HOME is correctly set, but that there is a connection failure when the OCI8 extension uses the Oracle OCI API. This API requires access to several files in the Oracle distribution which, at least in the 10g release 2 distribution, are not available to 'others'. It seems this may be the reason that we are directed to give oracle 'oinstall' group access to the apache user. For those who do not consider this a good idea, the solution is to grant 'other' access to the files. I used the following script (YMMV) .... export ORACLE_HOME=<your-Oracle-home-here> chmod o=x $ORACLE_HOME/network chmod o=x $ORACLE_HOME/network/admin chmod o=r $ORACLE_HOME/network/admin/tnsnames.ora chmod o=r $ORACLE_HOME/nls chmod o=r $ORACLE_HOME/nls/data chmod o=r $ORACLE_HOME/nls/data/* chmod o=x $ORACLE_HOME/oracore chmod o=x $ORACLE_HOME/oracore/zoneinfo chmod o=r $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat chmod o=r $ORACLE_HOME/rdbms chmod o=r $ORACLE_HOME/rdbms/mesg chmod o=r $ORACLE_HOME/rdbms/mesg/* The ORACLE_HOME environment variable *IS* required, but I found no need to set the others (again, YMMV). To discover the files referenced by your OCI8 scripts, you can open the security by giving apache group access to the Oracle directories, touching some temp file and using 'find' to discover the files which have been accessed. Try using... cd $ORACLE_HOME find . -anewer <my-touched-temp-file> -print --was-- The error message "There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory" is somewhat deceptive in that it can be emitted even when ORACLE_HOME is correctly set, but that there is a connection failure when the OCI8 extension uses the Oracle OCI API. This API requires access to several files in the Oracle distribution which, at least in the 10g release 2 distribution, are not available to 'others'. It seems this may be the reason that we are directed to give oracle 'oinstall' group access to the apache user. For those who do not consider this a good idea, the solution is to grant 'other' access to the files. I used the following script (YMMV) .... export ORACLE_HOME=<your-Oracle-home-here> chmod o=x $ORACLE_HOME/network chmod o=x $ORACLE_HOME/network/admin chmod o=r $ORACLE_HOME/network/admin/tnsnames.ora chmod o=r $ORACLE_HOME/nls chmod o=r $ORACLE_HOME/nls/data chmod o=r $ORACLE_HOME/nls/data/* chmod o=x $ORACLE_HOME/oracore chmod o=x $ORACLE_HOME/oracore/zoneinfo chmod o=r $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat chmod o=r $ORACLE_HOME/rdbms chmod o=r $ORACLE_HOME/rdbms/mesg chmod o=r $ORACLE_HOME/rdbms/mesg/* The ORACLE_HOME environment variable *IS* required, but I found no need to set the others (again, YMMV). To discover the files referenced by your OCI8 scripts, you can open the security by giving apache group access to the Oracle directories, touching some temp file and using 'find' to discover the files which have been accessed. Try using... cd $ORACLE_HOME find . -anewer <my-touched-temp-file> -print http://php.net/manual/en/ref.oci8.php

« previous php.notes (#138154) next »