How to fix WordPress image upload errors caused by file permissions and PHP limits

When uploading new images to the WordPress Media Library, users sometimes encounter frustrating errors like:

“Sorry, this file could not be uploaded” or “The uploaded file exceeds the upload_max_filesize directive in php.ini.”

This issue often appears after hosting migrations, theme updates, or plugin changes. Recently, our support team resolved this issue for a WordPress website hosted on Pressable, and this guide outlines exactly how we diagnosed and fixed it — so you can, too.

Issue background

The client reported that image uploads were failing across the site’s Media Library. Even small image files were throwing generic upload errors in WordPress.
Initial testing confirmed that:

  • The Media Library returned errors for all uploads (even <1MB files).
  • No recent changes were made to the theme or plugins.
  • The site was hosted on a managed Pressable server.

This behavior pointed to either a file permission issue or PHP configuration limit preventing uploads.

Diagnosis

Our first step was to inspect PHP error logs in Pressable’s Dashboard → Logs → PHP Logs, which revealed warnings related to temporary file handling:

Warning: move_uploaded_file(/tmp/php3X5.tmp): failed to open stream: Permission denied in /wp-admin/includes/file.php on line 950

This confirmed that WordPress was unable to move uploaded files into the wp-content/uploads directory — a classic indicator of incorrect file or folder permissions.

We also checked server limits using:

php -i | grep upload_max_filesize
php -i | grep post_max_size

Values were set to 2M, which is below typical upload needs.

Resolution steps

  1. Correct file permissions
    Connected to the site via SSH (using Pressable’s credentials).
    Navigated to the uploads directory:

    cd wp-content/uploads
    

    Reset ownership and permissions:

    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;
    

    Confirmed ownership was correctly assigned to the web server user.

  2. Increase PHP upload limits
    Created or edited a .user.ini file in the root directory with:

    upload_max_filesize = 64M
    post_max_size = 64M
    max_execution_time = 300
    

    Saved and cleared Pressable cache from the control panel.

  3. Regenerated Media Library paths
    Installed and ran the “Regenerate Thumbnails” plugin to ensure image metadata was rebuilt.
  4. Tested uploads
    Uploaded a 5MB JPEG image successfully.
    Confirmed thumbnails were generated and images displayed correctly on the frontend.

Final outcome

After resetting file permissions and increasing PHP upload limits, all image uploads worked correctly again.
No further issues were detected in the error logs, and the client confirmed the Media Library was fully functional.

Takeaway for WordPress users

If you encounter file upload issues in WordPress:

  • Always check file permissions on /wp-content/uploads/.
  • Review your PHP limits (upload_max_filesize and post_max_size).
  • Look for server-side caching or security plugins that might block uploads.

Hosting environments like Pressable, paired with caching tools such as WP Rocket, can sometimes mask PHP configuration changes, so clearing all caches after adjustments is essential.

Need help troubleshooting a similar issue on your WordPress site?
👉 Contact Freshy to get expert support from our WordPress team.