note 54755 added to function.ocilogon
| From: | ben at onshop dot co dot uk | Date: | Thu, 14 Jul 2005 12:25:24 +0000 |
| Subject: | note 54755 added to function.ocilogon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91957@lists.php.net to get a copy of this message | ||
There is a useful solution to the problem of securing connection information in the PHP Cookbook
(O'Reilly) by David Sklar and Adam Trachtenberg. They propose using 'SetEnv' in the
Apache configuration and then accessing the values from within a script using $_SERVER.
Unfortunately using the 'SetEnv' solution exposes your connection information to all users
of that virtual host. If they run phpinfo.php or display $_SERVER, I found that they will see the
password from any file under the root of that virtual host.
To restrict exposure to a particular directory or specific file:
1. First put an 'Include' to the secret file in httpd.conf. For example:
Include "/web/private/secret.txt"
2. In the password file, use the 'SetEnvIf' directive to enable the Environment variables
by directory only or within a specific file. For example:
- For all files in the directory:
SetEnvIf Request_URI "/path/to/my/directory" ORACLE_PASS=5gHj790j
- For a specific file in the directory
SetEnvIf Request_URI "/path/to/my/directory/connection.oracle.php" ORACLE_PASS=5gHj790j
----
Manual Page -- http://www.php.net/manual/en/function.ocilogon.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54755
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54755&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54755&report=yes
Search -- http://master.php.net/manage/user-notes.php