Protect php dot ini file from being viewed

by Hiroshi on September 9, 2008

in Security

Prevent people to view your php.ini file via a browser a few lines needed to be put into the .htaccess file.

Locate your .htaccess file which will be in your site’s root directory (public_html or www)
Download and edit .htaccess
Paste the following code into the bottom of the file and then click save:

<files php.ini>
Order allow,deny
Deny from all

Now your php.ini file is protected and which can help php crackers from finding exploits on your site.

Related Posts

Previous post:

Next post: