Re: The secrecy of PHP code
| From: | Garth Dahlstrom | Date: | Tue, 14 Aug 2001 05:34:16 +0000 |
| Subject: | Re: The secrecy of PHP code | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62570@lists.php.net to get a copy of this message | ||
Of course the absolute safest way besides encryting
your PHP is to just store your state secrets in files
outside the web server's document tree.
i.e.
if your web server's document root is /var/www
<?php
require("/var/super-secret/super-functions.php");
if ($theanswer == 42)
{
echo (findthequestion($theanwer));
}
?>
then even if you screw up the web server config
and .php files are sent back unrendered all you
expose is what's in the file above but not what was
included/required statements.
This is an excellent way to protect sensitive info
like database passwords too.
-Ironstorm
Northern.CA ===--
http://www.northern.ca
Canada's Search Engine