Loading...

Knowledge Base
70% Off, KB AD
Save up to  70% off.  Start your website today!
Categories:

What is php.ini?

Share

 

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

This article will discuss the following topics.


How to modify PHP settings

via the MultiPHP INI Editor

There may be times when you need to change some of the default PHP settings, and below we've outlined those steps. However, keep in mind that there are PHP settings that cannot be changed on our Shared, Cloud, and Reseller hosting plans.

To modify the PHP settings:

  1. Log in to cPanel. There are two ways to access your cPanel.
    • Option 1: Access your cPanel directly.
    • Option 2: Access your cPanel via your Customer Portal.
      1. Log in to your Customer Portal.
      2. Click Hosting in the left-side menu.

        Customer Portal - Hosting menu

      3. If you have a single hosting package in your account, scroll down to the Quick Links section.


        If you have multiple hosting packages in your account, locate the hosting package you want to manage on the Hosting Packages page, then click its Manage button.

        Hosting tab - Manage button

      4. Under the Quick Links section, click the cPanel button.

        Hosting menu - Quick Links - Launch cPanel

  2. In the Software section, click on the MultiPHP INI Editor icon.

    cPanel - MultiPHP INI Editor

  3. On the MultiPHP INI Editor page, select Home Directory or the specific domain you wish to update from the Configure PHP INI basic settings dropdown.

    HostGator Customer Portal Single Sign-On for cPanel

  4. Select the new setting for each PHP directive you would like to change.

    HostGator Customer Portal Single Sign-On for cPanel

  5. Click Apply to save your changes.

How to create a new php.ini file

Important Note: HostGator won't know why you want or need to change these settings. You would change this on the advice of your web designer or the developer of your script. HostGator can only show you where to make the change.
  • For Plesk users, the file should already exist in the directory  /var/www/vhost/$DOMAIN/etc/php.ini.
  • For the cPanel, this file should be created in your Home directory (/home/username/).

The username is your actual cPanel username, and $DOMAIN is your actual domain.

To create a new php.ini file in your cPanel:

  1. Log in to cPanel. (See options above on how to log into your cPanel)
  2. Under the Files section, click on the File Manager icon.

    cPanel - File Manager

  3. Select the root directory for your site. The default for the primary domain is public_html.
  4. Click the + File button at the top left of the page.

    File Manager - New File

  5. In the pop-up box, enter php.ini in the New File Name field. Make sure the root directory is in the bottom box.

    File Manager - Add New php.ini File

  6. Click Create New File.
  7. Locate and right-click the new php.ini file, and select Edit, then click the Edit button again.
  8. You can now input the contents of your php.ini file. Click Save to save your changes.

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...