If you run the risk of someone accessing your php.ini or php.cgi files directly through their browsers, you can limit access to them using .htaccess.
To enable this, create a .htaccess file following the main instructions and guidance, and include the following text:
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
|
|
|
|
<- Preventing access to your PHP includes files
|
Forcing scripts to display as source code ->
|
|
Visitor Comments and Responses
|
|
Average Rating: 5.67 out of 10 (3 Votes)
|
|
|