note 31441 added to function.parse-ini-file

From: Date: Tue, 22 Apr 2003 09:55:38 +0000
Subject: note 31441 added to function.parse-ini-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-46923@lists.php.net to get a copy of this message
A simple way of increasing security for .ini files when circumstances require them to be sat in your webroot (such as shared/limited-access hosting), is to prepend the following lines to your ini file. ; <?php /* Send Notification */ error_log('Unauthorised web access to *.ini file (file:' . $_SERVER['SCRIPT_FILENAME'] . ')',1,$__EMAIL_ADDRESS__); ?> ; <?php /* Log error in file */ error_log('Unauthorised web access to *.ini file (file:' . $_SERVER['SCRIPT_FILENAME'] . ')',3,$__ROOT_TO_LOGS__); ?> ; <?php exit("Unauthorised web access to *.ini file.\n\nPermission Denied.\nTerminated."); ?> ; ; Rest of ini file below... The second line may be removed should your host not allow logging. This will then notify you of any problems so you can take action. Dysfunktional Monkey -- http://www.php.net/manual/en/function.parse-ini-file.php http://master.php.net/manage/user-notes.php?action=edit+31441 http://master.php.net/manage/user-notes.php?action=delete+31441 http://master.php.net/manage/user-notes.php?action=reject+31441

« previous php.notes (#46923) next »