zaf
zaf

Reputation: 23244

Block access to php.ini file

We have a custom php.ini and .htaccess file in the root of the web tree.

The .htaccess cannot be accessed by default but the php.ini can be accessed.

For example:

http://example.com/php.ini

Whats the recommenced procedure to block access to the php.ini file?

Upvotes: 3

Views: 3352

Answers (2)

Peter Stuart
Peter Stuart

Reputation: 2434

Change the CHMOD or permissions so it is not executable by the user.

Upvotes: -2

Matt
Matt

Reputation: 7249

Also if you must have it in the public folder try:

<Files php.ini>
  order allow,deny
  deny from all
</Files>

Upvotes: 15

Related Questions