note 61817 added to ref.oci8
| From: | jnavratil at houston dot rr dot com | Date: | Mon, 13 Feb 2006 01:30:02 +0000 |
| Subject: | note 61817 added to ref.oci8 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103592@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
----
Server IP: 64.246.30.37
Probable Submitter: 24.160.91.37
----
Manual Page -- http://www.php.net/manual/en/ref.oci8.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61817
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61817&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61817&report=yes
Search -- http://master.php.net/manage/user-notes.php