How to edit PHP variables

Published: July 31, 2023

Some applications and plugins may require a higher memory limit and execution time, or you may wish to have a higher upload size limit for your files. To change these options, you’ll need to edit the PHP variables:

1. Login to your cPanel account.

2. In the Software section, click Select PHP Version.

3. In the Options tab, you’ll see some options and variables such as memory_limit, max_execution_time, and upload_max_filesize. Change them to the desired value.

A loading icon will appear. Once complete, a success message will pop up in the top right corner.

Edit PHP variables via .htaccess 

You may also try to edit the PHP variables directly via the .htaccess file in case there’s a specific variable that’s not available through the options. Please note that the values are still contained within the limits of your plan’s resources.

1. Login to your cPanel account.

2. In the Files section, click File Manager.

3. Navigate to your domain’s root folder. Here, locate the .htaccess file, right-click, and Edit. If you don’t see any dotted files, click Settings in the top right corner and check the option Show Hidden Files.

4. In the edit page, add a new line at the very end of the file. If you wished to increase the upload size, the following would be added:

php_value upload_max_filesize 128M 
php_value post_max_size 128M

5. Save Changes to save the file.