最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - WordPress Media Uploads on IIS Returning 500 Error (After Cloning to Staging)

programmeradmin10浏览0评论

WordPress Media Uploads on IIS Returning 500 Error (After Cloning to Staging)

Issue:

WordPress media uploads appear in the Media Library but fail to load when viewed directly, returning a 500 Internal Server Error.

Key detail:

✅ Existing images (pre-clone) still work fine on both production & staging.
✅ Cloned images on staging also work fine.
❌ Newly uploaded images fail on both production and staging (even re-uploads of old working images).

Environment:

  • Windows Server + IIS
  • PHP 7.4 via FastCGI
  • WordPress (cloned from production → staging)
  • Standard web.config rewrite rules in place
  • File permissions confirmed: IUSR has full control over wp-content/uploads/
  • No PHP errors logged (despite enabling error logging)

Steps Taken So Far:

✔ File permissions check – IUSR has full control over uploads directory.
✔ Disabled caching/image optimization plugins (WP Rocket, Smush).
✔ Re-uploaded old images (previously working ones) – still fail with a 500 error.
✔ Checked and recreated .htaccess / web.config – standard WordPress rewrite rules in place.
✔ Enabled PHP error logging – but no logs are being generated.
✔ Confirmed IIS is correctly handling PHP 7.4 via FastCGI.
✔ Checked IIS request filtering – image extensions are allowed.
✔ Attempted accessing images directly via browser – 500 error.

Important Observations:

  • Pre-existing images (from before the clone) work fine everywhere.
  • Cloned images work fine in staging.
  • Newly uploaded images (in either environment) fail with a 500 error.
  • Uploads are successful (files are present on disk in the correct directory).
  • No PHP errors are being logged, suggesting the request is failing at the server level.

Potential Theories:

Would love to hear from anyone who has experienced this on an IIS-hosted WordPress site. What else should I check? Any known fixes for this specific scenario? Thanks in advance!

发布评论

评论列表(0)

  1. 暂无评论