If you are using assistive technology and are unable to read any part of the HostMonster website, or otherwise have difficulties using the HostMonster website, please call 866-573-HOST and our customer service team will assist you.
Skip to main content

HostMonster Web Hosting Help

Protecting the php.ini file from being viewed

To prevent people to viewing your php.ini file via a browser a few lines need to be pasted into the .htaccess file.
  1. Log in to your HostMonster cPanel account.
  2. Click on File Manager (if prompted, select the checkbox to view hidden files)
  3. Double-click on the public_html folder to open it
  4. Right-click on the .htaccess file and then select the "Edit".
  5. Paste the following code into the bottom of the file and then click save:

<Files php.ini>
              Order allow,deny
              Deny from all
            </Files>
Now your php.ini file is protected. This change prevents php hackers from finding exploits on your site.

Knowledgebase Article 90,967 views bookmark tags: exploit hide php prevent


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

This article will explain how to run php and other file types using Cron jobs.
Knowledgebase Article 401,498 views tags: cron file jobs php

How do I increase my file size limit in my PHP application?
Knowledgebase Article 478,317 views tags: optimize php upload uploads

Script executed with a cron job requires a specific php.ini file to be used.
Knowledgebase Article 125,417 views tags: command cron cronjob crontab custom line optimizer php zend

Related Help Content

This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files.
Knowledgebase Article 215,720 views tags: htaccess php

How can I adjust the php settings specifically for an Addon Domain?
Knowledgebase Article 168,916 views tags: domain php

How do I change the PHP environment for my site with php.ini?
Knowledgebase Article 630,439 views tags: configuration ini php server

How do I redirect users to another page using PHP?
Knowledgebase Article 404,525 views tags: header location php redirect redirects

The hosts file is a plain text file that allows you to set IP Addresses for a domain on your computer. This may override authoritative DNS.
Knowledgebase Article 11,778 views tags: admin development dns file hosts ip test

Changing PHP versions, load custom Apache mods, and other Apache/PHP customizations
Knowledgebase Article 78,157 views tags: easyapache php vps whm

This article will outline which PHP PEAR Packages are installed and how you can install additional PHP PEAR Packages.
Knowledgebase Article 116,309 views tags: package pear php

How to change your PHP version in your hosting account
Knowledgebase Article 509,828 views tags: config php selection version

This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here