The PHP language protects the optimal performance of the server by limiting the allowed file upload size on the hosting. However, this limit is usually much less than the amount required to install modern tools. You have probably encountered the error that your PHP hosting needs to increase the upload_max_filesize value, and the error will not be resolved until this problem is fixed. There are several ways to increase the file upload limit, including increasing this value through the configuration files related to your PHP hosting.
What is upload_max_filesize in PHP?
The upload_max_filesize option in PHP is actually a variable that is defined and set in the php.ini and user.ini configuration files. In php.ini and user.ini files, the default configuration related to the PHP language is done. As you have noticed, we use the upload_max_filesize variable to set the allowed size for uploading a file to the hosting. Usually, this value is 2 MB by default, and to upload files larger than 2 MB, we need to increase this value.
You may also need to adjust the values of other variables:
- post_max_filesize, which should be greater than upload_max_filesize
- memory_limit, which should be greater than post_max_filesize
The size of these values in PHP is defined in bytes. For example, if we set the upload_max_filesize to 1000, it means that the value is 1000 bytes. However, we can use letters to change the value from bytes to larger sizes such as kilobytes, megabytes, and gigabytes. These letters are defined as follows:
- The letter K to define the value in kilobytes
- The letter M to define the value in megabytes
- The letter G to define the value in gigabytes
So, if we set the value to 1000K, it means the value is 1000 kilobytes, or if we set it to 10G, it means 10 gigabytes.
Keep in mind that defining the upload_max_filesize value in cPanel varies depending on the PHP configuration management interface in cPanel hosting.
In this article, we will explain how to define and change this value in PHP Selector and MultiPHP.
Changing the upload_max_filesize Value in MultiPHP
If your hosting uses MultiPHP to manage your PHP, go to the MultiPHP INI Editor option on your hosting’s main page and, using the dropdown menu on the first page, select the directory where you want to change the PHP configuration values. By default, you need to select Home Directory.

After selecting the directory, scroll down the page and change the value next to upload_max_filesize. Make sure that the post_max_filesize value is greater than the upload_max_filesize value, and then select the Apply option.

Changing the upload_max_filesize Value in Select PHP Version
First, go to the Select PHP Version option in cPanel. On the first page, there are three main tabs: My domains, Extensions, and Options. Note that your hosting’s PHP version should not be set to native, because in this case you cannot change the PHP configuration values.

Go to the Options tab and then scroll down the page. In the section opposite the upload_max_filesize option, you can select your desired value to set for this variable. Also, keep in mind that this value should not be greater than the post_max_filesize value.
