Articles on: Technical

How to Modify the PHP Max Upload Size?

How to Modify the PHP Max Upload Size



When you try running a script, plugin, or uploading large files to your website, you might encounter an error. One of the possible causes of this issue is that the upload exceeds the default maximum file size configuration on your web server.

1. Altering PHP Parameters Using cPanel



The easiest way to modify the PHP maximum upload size is to use cPanel. To do this, follow these steps:

Log in to your cPanel account.
Click on the Software section.
Click on the MultiPHP INI Editor link.
MultiPHP INI Editor
Select the domain that you want to modify the upload size for and click apply.
Select Domain
Scroll down to the Upload Max Filesize setting, enter the desired maximum upload size in MB, and click on the Apply button.
Upload Max Filesize

2. Changing PHP Post Max Size via the .htaccess File



To change your post size limits using PHP scripts:

Navigate to File Manager in your cPanel.
File Manager
Open the public_html folder and find .htaccess.
.htaccess
Open the file and insert the following PHP scripts:

```php
php_value upload_max_filesize XXM
   php_value post_max_size XXM


Change the “XX” into your desired size.
Once you’re done with the configuration, click Save & Close.


Please note that the images are included as they were in the HTML, and you may need to adjust the URLs based on your hosting or file storage.

Updated on: 23/11/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!