How to Increase PHP Maximum Upload Limit

Maximum upload limits are set to a website hosting to prevent any unauthorised uploads. This also helps maintain the performance of a website by making sure the files do not go beyond what the hosting server can handle.  

This article is the solution if you get the error shown in the screenshot below when trying to upload a file to your website.  

Maximum Upload Size Exceeded Error in WordPress

There are three ways on how to increase the php maximum upload of a hosting. 

Via Php.ini File

This way is recommended if you don’t have access to the cPanel but have an access to FTP. Follow the steps below on how to increase the upload limit in a php.ini file.  

  1. Look for aphp.ini file in your website’s home directory. If there is none, create a website file with a file name of php.ini 
  2. Copy the code shown below and paste it in the php.ini file. Configure the value, located after the equal sign, based on the file to be uploaded. 

upload_max_filesize = 64M 
post_max_size = 64M 

  1. Save the changes.  
  2. Test this by uploading a file to your website or creating a phpinfo.php file. The changes should take effect right away.  

Via .htaccess File

This is an option if you don’t have access to the cPanel but have an access to FTP. Follow the steps below if uploading of php.ini file does not work. 

  1. Look for the.htaccess file in your website’s home directory. 
  2. Copy the code shown below and paste it in the .htaccess file. Configure the value based on the file to be uploaded. 

php_value upload_max_filesize 512M 
php_value post_max_size 512M 

  1. Save the changes.  
  2. Test this by uploading a file to your website or creating a phpinfo.php file. The changes should take effect right away. 

Via Control Panel

The maximum upload limit can easily be configured inside cPanel. Follow the steps below on how to do it.  

Note: The changes made herein affects all websites hosted in this particular cPanel account.

Step 1Log in to cPanel.    

Step 2. Click Select PHP version under Software.  

Select Php Version Option in cPanelStep 3. Click Options.  

Php Options in cPanel

Step 4. Select the desired values for post_max_size and upload_max_filesize 

Select Max Upload Limit Under Php Options

Step 5. The changes are automatically saved. Test this by uploading a file to your website or creating a phpinfo.php file. The changes should take effect right away. 

Feel free to contact our Singapore or Australia Support Team if you have further questions. 

(Visited 533 times, 1 visits today)