Bluehost 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 Bluehost 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 155,814 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

Cron Jobs with PHP and other File Types

This article will explain how to run php and other file types using Cron jobs.

What to do if your Site Does Not Work with Newer Versions of PHP

Many popular website platforms use PHP for rendering their content. It’s common for these sites to have automatic update tools to ensure that they work with the latest version of PHP, however sometimes a theme or plugin for these services may prevent them from updating or may not work with a newer

How To Change Upload File Size Limit In PHP - Increase Upload Limits

How do I increase my file size limit in my PHP application?

Related Help Content

Specify a Cron Job to Use a Specific phpini File

Script executed with a cron job requires a specific php.ini file to be used.

How To Add Handlers To Change PHP Version - PHP Version Setup

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.

PHP Configuration for Addon Domain

How can I adjust the php settings specifically for an Addon Domain?

How To Code a PHP Redirect - PHP Header Redirect

How do I redirect users to another page using PHP?

How to Change your Hosts File

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.

How To Configure The PHP Environment With PHP ini

How do I change the PHP environment for my site with php.ini?

PHP PEAR Packages

This article will outline which PHP PEAR Packages are installed and how you can install additional PHP PEAR Packages.

Change Your PHP Version - Dedicated and VPS Hosting

Changing PHP versions, load custom Apache mods, and other Apache/PHP customizations