How to Edit PHP Environment (php.ini) Values in cPanel
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
- 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.
- Open your web browser and navigate to your cPanel login page (usually
- Locate the “MultiPHP INI Editor”
- Once logged in, scroll down to the Software section
- Click on MultiPHP INI Editor.
- 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.
- Under the Basic Mode tab, select the domain or directory for which you want to edit
- 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.
- Locate the setting you wish to change (e.g.,
- 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:
- Open File Manager and navigate to the root directory of your website.
- Locate or create a
php.ini
file. - Right-click the file and select Edit.
- Add or modify PHP settings, e.g.:
memory_limit = 256M upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
- Save the changes and verify using the
phpinfo.php
file.
Article Overview