/

/

How to Edit PHP Environment (php.ini) Values in cPanel

How to Edit PHP Environment (php.ini) Values in cPanel

Last Modified: February 26, 2025
(Rev. v3.0)
by Ryan T. M. Reiffenberger

ADVANCED GUIDE – PROCEED WITH CAUTION

This guide is more technically advanced and may require an additional level of knowledge beyond everyday website operation. If you have difficulting following this guide, or want further assistance, please contact our team using the chat link at the bottom of your screen. When in doubt, chat before you click.

The php.ini file is the main configuration file for PHP settings on your web server. If you need to modify PHP settings, such as increasing the memory limit, max execution time, or file upload size, you can do so via cPanel. This guide will walk you through the steps to edit php.ini values in cPanel.

Edit php.ini in cPanel

  1. Log into cPanel
    • Open your web browser and navigate to your cPanel login page (usually yourdomain.com/cpanel).
    • Enter your cPanel username and password, then click Log in.
  2. Locate the “MultiPHP INI Editor”
    • Once logged in, scroll down to the Software section
    • Click on MultiPHP INI Editor.
  3. Choose the Domain or Directory
    • Under the Basic Mode tab, select the domain or directory for which you want to edit php.ini settings.
    • A list of configurable PHP settings will appear.
  4. Modify php.ini Values
    • Locate the setting you wish to change (e.g., memory_limit, upload_max_filesize, post_max_size, max_execution_time)
    • Enter the desired value for the setting.
    • Click Apply to save your changes.
  5. Verify Changes
    To verify that the changes have taken effect, create a PHP info file:

    • Open File Manager in cPanel.
    • Navigate to the public_html directory.
    • Click +File and name it phpinfo.php.
    • Edit the file and add the following code:
      <?php
      phpinfo();
      ?>
      
    • Save the file and visit yourdomain.com/phpinfo.php in your browser.
    • Look for the modified values in the PHP configuration table.

Alternative Method: Editing php.ini via File Manager

If your cPanel does not have the MultiPHP INI Editor, you can manually edit the php.ini file:

  1. Open File Manager and navigate to the root directory of your website.
  2. Locate or create a php.ini file.
  3. Right-click the file and select Edit.
  4. Add or modify PHP settings, e.g.:
    memory_limit = 256M
    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
    
  5. Save the changes and verify using the phpinfo.php file.

Article Overview

The php.ini file is the main configuration file for PHP settings on your web server. If you need to modify PHP settings, such as increasing the memory limit, max execution time, or file upload size, you can do so via cPanel. This guide will walk you through the steps to edit php.ini values in cPanel.

On this page

Topics Discussed

Share this article

Email Article

Black Friday is Here!

Get 50% Off Your Web Hosting Account + MORE