How do I protect the php.ini file from being viewed online?

The php.ini file is an important file in any website. It gives the configuration of the website and the variables that are used to make the site work (thus, a possible security exploit). So we suggest that you make the following in your .htaccess file (within the /public_html/ folders that disables web access to this file):

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

With the above update in place, your php.ini is now protected and can't be downloaded or viewed.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How do I modify the inbox size within cPanel?

When you successfully create mail account in cPanel, the default quota will be assigned to the...

How do I block an IP address using cPanel?

If you want to prevent an IP address or a whole range of IP addresses from accessing your site,...

After suspension, my databases are not working

If you are getting the following message; "Error establishing a database connection", this is a...

Does my hosting account have a file count (inode) limit?

All hosting accounts / providers have some sort of file count limit. The file count limit to...

How do I obtain Raw Access Logs?

Raw Access Logs are logs that are going to give you the most information about your sites...