or
FAQ icon (Q)

Change the PHP maximum upload file size limit

This article explains how to change the maximum upload file size for PHP contents by utilizing the upload_max_filesize and post_max_size orders in a .htaccess document.

You may need to change the maximum upload file size for your site. But for security reasons, you must set a lower value to keep clients from uploading very large documents to your site. To do this, change the upload_max_filesize and post_max_size orders in .htaccess file.

Sign in to your cPanel and locate your .htaccess file under public_html and add below lines:

php_value upload_max_filesize 256M
php_value post_max_size 256M

To ensure that uploads work accurately, the post_max_size should be a little large than upload_max_filesize. For example, you can set the upload_max_filesize to 100M, and the post_max_size order to 102M.

Save to the .htaccess records and check your WordPress.

Change PHP Maximum Upload Size Using .user.ini -

If you are not able to increase maximum upload file size using .htaccess then probably the server you are using configured for .user.ini. Create a file .user.ini under public_html and add below lines:

upload_max_filesize = 256M
post_max_size = 256M

You can also verify using phpinfo function, make a PHP test file that contains the below code in a similar index where the .htaccess record is found:

phpinfo();

Load the test file in your internet browser, and afterward check for the name of the value.

Did this help you?
100% found this useful
Thank you for submitting your feedback

Reseller Hosting

We at Cyberin designed a reseller plan for those who want to take their first step in hosting business as always dreamed, latest cPanel, premium add ons, World-class data centers and almost 100% uptime

Try ₹149 only

Shared Hosting

Seamless cheapest cPanel hosting for a personal site to a giant client, deploy thousands of open source apps on one click, or import a project from GitHub, everything is smooth and simple as possible.

Try ₹29 only