Why Adjust PHP File Upload Limits?
By default, most web hosting providers set conservative PHP limits to optimize server performance. However, if you’re handling large media files, database imports, or resource-heavy applications, you may need to increase these limits.
Common Reasons for Increasing PHP Limits:
- Uploading large media files (images, videos, PDFs, etc.)
- Running scripts that require more memory
- Increasing the maximum file size allowed for user uploads
- Preventing timeout errors when processing data
Step-by-Step Guide to Increasing PHP Limits via cPanel
Step 1: Log Into Your cPanel
- Open your web browser.
- Enter your cPanel login URL: https://yourdomain.com/cpanelor access cPanel through your hosting provider’s client area.
- Enter your username and password, then click Log in.
Step 2: Locate the MultiPHP INI Editor
- Scroll down to the Software section.
- Click on MultiPHP INI Editor.
Step 3: Select a Location
- In the MultiPHP INI Editor page, you will see a dropdown menu.
- Select the domain or the home directory where you want to apply the changes.
Step 4: Modify PHP Directives
Once you have selected your domain, a list of PHP directives will be displayed. You can adjust the following values according to your needs:
| Directive | Purpose | Recommended Value | 
|---|---|---|
| upload_max_filesize | Defines the max file upload size | 64M - 512M | 
| post_max_size | Controls max post request size | 64M - 512M | 
| memory_limit | Sets PHP memory allocation | 128M - 1024M | 
| max_execution_time | Prevents script timeouts | 300 - 600sec | 
| max_input_time | Controls the time to parse input data | 300sec | 
Example Configuration:
To increase the maximum upload size from 2MB to 64MB, update:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300Step 5: Save Changes
Once you have adjusted the necessary settings:
- Scroll down and click Apply or Save.
- Your new PHP settings will be applied immediately or within a few minutes.
Alternative Method: Editing php.ini Manually
If your hosting provider does not offer the MultiPHP INI Editor, you can manually edit the php.ini file via File Manager or FTP.
Using File Manager in cPanel:
- Open cPanel > File Manager.
- Navigate to your website’s root directory (public_html).
- Look for a file named php.ini (if it does not exist, create one).
- Edit the file and add the following lines:
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 512M
max_execution_time = 600- Save and close the file.
- Restart the server (if required by your hosting provider).
Using FTP to Edit php.ini:
- Connect to your server using an FTP client (FileZilla, Cyberduck, etc.).
- Navigate to the public_html directory.
- Download the php.ini file.
- Edit it in a text editor and adjust the necessary values.
- Upload the modified file back to the server.
Verifying the Changes
To confirm that your new PHP settings are applied:
- Go to cPanel > MultiPHP INI Editor and check the updated values.
Create a new PHP info file:
- Open File Manager and navigate to public_html.
- Click New File and name it phpinfo.php.
- Open the file and insert the following code:
     <?php phpinfo(); ?>
- Save the file and access it via https://yourdomain.com/phpinfo.php.
- Search for upload_max_filesize, post_max_size, and memory_limit to confirm changes.
Best Practices When Increasing PHP Limits
- Use Reasonable Values – Setting limits too high may affect server performance.
- Understand Measurement Units – Use Mfor megabytes andGfor gigabytes (e.g.,128M,1G).
- Optimize Server Resources – Increasing memory limits is useful, but also consider optimizing code efficiency.
- Monitor Performance – Test your website after making changes to ensure everything functions correctly.
- Consult Your Hosting Provider – Some providers impose restrictions; contact support if changes don’t apply.
Troubleshooting Common Issues
1. Changes Are Not Applying?
- Restart Apache or LiteSpeed (depending on your server type).
- Check if your hosting plan allows modifications to php.ini.
- Verify there is no .htaccessrule overriding your settings.
2. File Upload Still Fails?
- Ensure post_max_sizeis equal to or larger thanupload_max_filesize.
- Increase memory_limitif the error persists.
- If using Nginx, adjust client_max_body_sizein the Nginx config.
3. PHP Info Page Shows Old Values?
- Clear your browser cache and refresh phpinfo.php.
- If on shared hosting, changes may take up to 15 minutes to apply.
Conclusion
Adjusting PHP file upload limits via php.ini in cPanel is a simple yet powerful way to manage your website’s resource allocation. Whether you use the MultiPHP INI Editor or manually edit the php.ini file, these changes can help accommodate larger file uploads, prevent timeout errors, and enhance performance.
Following the steps outlined in this guide ensures your website runs smoothly, efficiently handling larger file uploads and memory-intensive tasks.
If you encounter issues, don’t hesitate to reach out to your hosting provider for support!

 
			