note 128985 added to function.parse-ini-file
| From: | manngo at main dot php dot net | Date: | Mon, 30 Oct 2023 09:49:28 +0000 |
| Subject: | note 128985 added to function.parse-ini-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220942@lists.php.net to get a copy of this message | ||
Securing your .ini file:
âini files are generally treated as plain text by web servers and thus served to browsers if
requested. That means for security you must either keep your ini files outside of your docroot or
reconfigure your web server to not serve them. Failure to do either of those may introduce a
security risk.â
Alternatively, you can save you file as:
stuff.ini.php
add this to the beginning:
;<?php die('go away'); ?>
The semicolon at the beginning is treated as comment, so this line has no effect on the ini file.
Since the file has a .php extension, it will run through the PHP interpreter if you attempt to
access this file directly, and the php block will be processed and exit.
The file extension has no ill effect on the parse_ini_file() function, and the .ini part is, of
course, a matter of taste.
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 159.196.219.235)
----
Manual Page -- https://php.net/manual/en/function.parse-ini-file.php
Edit -- https://main.php.net/note/edit/128985
Del: integrated -- https://main.php.net/note/delete/128985/integrated
Del: useless -- https://main.php.net/note/delete/128985/useless
Del: bad code -- https://main.php.net/note/delete/128985/bad+code
Del: spam -- https://main.php.net/note/delete/128985/spam
Del: non-english -- https://main.php.net/note/delete/128985/non-english
Del: in docs -- https://main.php.net/note/delete/128985/in+docs
Del: other reasons-- https://main.php.net/note/delete/128985
Reject -- https://main.php.net/note/reject/128985
Search -- https://main.php.net/manage/user-notes.php