Have a Question?

If you have any question you can ask below or enter what you are looking for!

Media Library Upload Errors in WordPress – PHP Settings Troubleshooting

Overview

When uploading files to the WordPress Media Library, you may encounter errors such as:

“Unexpected response from the server”
“HTTP error”
“The uploaded file exceeds the upload_max_filesize directive”
Upload progress bar stalling or timing out

These errors are most commonly caused by PHP configuration limits on the server. This guide will help you identify the cause and understand how to resolve it.

Common Causes

File Size Too Large

PHP has a maximum file size limit for uploads. If your file exceeds this limit, the upload will fail. This is the most common cause when uploading videos or large images.

PHP Memory Limit Too Low

WordPress requires sufficient PHP memory to process uploaded files. If the memory limit is too low, uploads may fail partway through.

PHP Execution Time Limit

Large file uploads take longer to process. If PHP’s maximum execution time is reached before the upload completes, it will time out and fail.

Server-Side Upload Limits

In addition to PHP limits, the web server (Apache or nginx) may have its own upload size restrictions.

How to Check Your Current PHP Settings

Via phpinfo

  1. Create a file called phpinfo.php in your WordPress root directory containing: <?php phpinfo(); ?>
  2. Visit yourdomain.com/phpinfo.php in your browser
  3. Search for the following values:
    • upload_max_filesize
    • post_max_size
    • max_execution_time
    • memory_limit
  4. Delete the file once you have noted the values — do not leave it publicly accessible

Recommended PHP Settings for Media Uploads

For most WordPress sites the following values are recommended:

SettingRecommended Value
upload_max_filesize128M or higher
post_max_size256M or higher (must exceed upload_max_filesize)
memory_limit256M or higher
max_execution_time300

How to Request a Limit Increase

If your current limits are too low and you are unable to adjust them yourself via cPanel, please raise a support ticket including:

  • Your hosting account username
  • The domain affected
  • The file size you are trying to upload
  • The exact error message you are seeing
  • The current PHP limit values from phpinfo (if available)

Our team will review and adjust the limits as appropriate for your hosting plan.

Best Practices for Large File Uploads

  • Compress files before uploading — use a tool to reduce video or image file sizes before uploading to WordPress
  • Use a chunked upload plugin — plugins such as WP Media Folder or similar can split large files into smaller chunks, bypassing server upload limits
  • Upload via FTP — for very large files, uploading directly to the wp-content/uploads directory via FTP and then importing into the Media Library can bypass PHP upload limits entirely
  • Use external media hosting — for video files, consider hosting on YouTube or Vimeo and embedding in WordPress rather than uploading directly

When to Escalate to Support

Please contact support if:

  • The file appears to have uploaded successfully but shows an error — the file may be partially uploaded and require cleanup
  • Limits have been increased but the error persists
  • You are seeing errors on small files that should be well within current limits
  • The issue started suddenly without any changes being made

In these cases the issue may be related to plugin conflicts, server resources, or another underlying cause that requires further investigation.