Increase the file upload or memory limit
Raise upload_max_filesize, post_max_size and memory_limit for large uploads.
Last updated
First identify which limit failed. A browser upload can hit upload_max_filesize or post_max_size; an import may instead run out of memory or execution time. Your application's own limit can be lower than PHP's.
Check the limit shown by your application
In WordPress, open Media β Add New to see the maximum upload size. Record that value before changing anything. If a site is already returning a 500 error, remove any recent PHP configuration edits before trying a new value.
For PHP-FPM or CGI/FastCGI, try a per-directory configuration
In the site's document root, create or edit .user.ini with values suited to your file size and plan. For a 64 MB upload, an example is:
upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
max_execution_time = 120
post_max_size must exceed the upload size. The host may enforce a lower ceiling; ask support if the displayed limit does not change after PHP has re-read the file. Never paste php_value directives into .htaccess on a PHP-FPM/FastCGI site: that can cause a 500 error. PHP documents which handlers read .user.ini.
Verify the result
Recheck the maximum in the application and retry a small test upload before the large one. Remove the temporary file afterward. For very large media or database imports, use a suitable transfer/import method or ask support instead of raising web-request limits indefinitely.
Still need a hand?
Open a ticket from your dashboard with your domain and a screenshot β our team replies fast.