In this article, we will learn how to increase the PHP upload limit in the Cpanel. You can increase using Select a PHP version. Using this interface you can also change the PHP version which is required for the website and it also has a set of the most commonly-referenced configuration options for PHP. It will also help you to diagnose problems with how your web site handles PHP packages. PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.
With default size, you will be only able to upload small files in webmail or with a PHP script, but larger files cannot be uploaded or you get "The page cannot be displayed" error when you push the "Send Message" button.
While there are several ways to remove this cap on file size, we’ll be working with three settings within PHP that should deal with the upload limit. Let’s define the settings first so that you know what you’re actually doing.
Steps to increase PHP Upload Limit and Post Max Size and Memory Limit:
Step 1: Login to cPanel Server >> search for ‘Select PHP Version’
Step 2: click on select PHP version under software >> Click on ‘Switch To PHP Options’
Step 3: After clicking on Switch to PHP Options >> then you need to set the following values and after making the changes remember to click on apply
Step 4: After you do required changes >> Click ‘Save’ button to save the changes.
The other PHP directives that are provided by way the select PHP version interface are listed with their description for each of the directives :
cPanel server change php.ini using the command line
You can change the PHP.INI config values by logging into to your command line, using SSH or putty program or directly logging into server console.
Once you login into your server in SSH, You will reach the bash prompt or shell.
You can find out the PHP.INI file using the following command
php -i | grep "php.ini"
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
As you can see the loaded config file above, Edit it using an editor such as vim/emacs/nano and modify the desired values.
$ vim /etc/php5/cli/php.ini
You can write a simple test.php file with the following content to know the php.ini path.
<?php
phpinfo();
?>
When you execute the command, You will know the loaded php.ini file and edit it.
If you need any assistance, feel free to contact our technical team members as they are available 24/7 via phone call, email, ticket system or call out to our toll-free number.
Page 9 of 9