1. Knowledge Base
  2. >
  3. Results
  4. >
  5. What is php.ini?

What is php.ini?


The php.ini file and changing PHP Settings

The php.ini file is a special file for PHP. The php.ini file is where you declare changes to your PHP settings. You can use the default settings for the server and change specific settings by using the MultiPHP INI Editor.


Default Settings

The server is already configured with standard settings for PHP, which your site will use by default. Unless you need to change one or more of the settings, there is no need to create or modify a php.ini file. If you would like to make any changes to settings, please do so through the MultiPHP INI Editor.

How To Modify PHP Settings

There may be times where you need to change some of the default PHP settings and below we've outlined those steps, however, keep in mind that on our Shared, Cloud, & Reseller hosting there are PHP Settings That Cannot Be Changed.

Modify PHP Settings with MultiPHP INI Editor :

  1. Login to cPanel.
  2. In the Software section, click on the MultiPHP INI Editor icon.
    cPanel MultiPHP INI Editor Plugin
  3. Under Configure PHP INI basic settings, select the Home Directory or specific domain from the drop-down.
    HostGator Customer Portal Single Sign-On for cPanel
  4. Under PHP Directive select the new setting for each PHP directive you would like to change.
    HostGator Customer Portal Single Sign-On for cPanel
  5. Then click Apply at the bottom to save your changes.

Create a php.ini File

This file should be created in your cPanel Home directory (/home/username/). For VPS Plesk users the file should already exist in the following directory:

  • /var/www/vhost/$DOMAIN/etc/php.ini

Be sure to replace "username" with your actual cPanel user name, and "$DOMAIN" with your actual domain.

How to create a new php.ini file in cPanel:

  1. Login to cPanel.
  3. Select the root directory for your site, the default for the primary is public_html.
  4. Click the New File button at the top of the page.
  5. In the field called New File Name, enter php.ini, make sure the root directory is in the bottom box, and click Create New File.
  6. Right-click the php.ini file and select Edit, and then click the Edit Edit button in the bottom corner of the pop-up box.

You can now input the contents of your php.ini file, click Save to save your changes, and then Close to return to the File Manager.

Note: HostGator won't know why you want or need to change these settings. You would change this at the advice of your web designer or the developer of your script. HostGator can only show you where to make the change.