What matters first: PHP needs a writable temporary directory before WordPress can move an uploaded file into wp-content/uploads. The error occurs before normal media permissions become relevant.
What this symptom actually tells you
Changing uploads permissions cannot fix a temporary-directory failure. The effective upload_tmp_dir, system temp path, free space and PHP user identify the broken layer.
Capture evidence before changing anything
- Check the effective upload_tmp_dir in the web PHP runtime.
- Verify the directory exists, has free space and is writable by the PHP-FPM user.
- Inspect open_basedir or container mounts that may hide the configured path.
- Test a small upload while watching the PHP error log.
Most common causes
- Directory missing: The configured temp path was removed or never mounted into the container.
- Ownership mismatch: Deployments or host changes left the directory writable only by another user.
- Disk or inode exhaustion: The path exists but cannot create another file.
- Restricted path: open_basedir, SELinux, AppArmor or a container boundary blocks access.
Safe diagnostic and repair sequence
- Create or mount the intended temporary directory with the correct owner and narrow permissions.
- Point upload_tmp_dir to a persistent path available to the active PHP runtime.
- Clear abandoned temporary files only after confirming they are not in use.
- Repeat small and realistic uploads and confirm temporary files are removed afterward.
How to choose between the likely causes
Do not treat Directory missing and Ownership mismatch as interchangeable. The configured temp path was removed or never mounted into the container. By contrast, deployments or host changes left the directory writable only by another user. Use two checks to separate them: Check the effective upload_tmp_dir in the web PHP runtime; and verify the directory exists, has free space and is writable by the PHP-FPM user. Those observations usually show whether the next safe move is to create or mount the intended temporary directory with the correct owner and narrow permissions or to preserve the current state and widen the investigation.
On a production WordPress site, repeat the failing request while checking a known-good page and the admin area. A fault isolated to one route calls for a narrower rollback than a failure affecting PHP, the database or every request. Record the exact timestamp, affected URL or transaction, last known good state and every change made during diagnosis. That handover is often what separates a repeatable repair from a temporary disappearance of the symptom.
What not to do
Do not use a world-writable shared directory without sticky-bit and isolation controls. Temporary uploads can contain sensitive customer data.
How to verify the repair
- Media uploads complete and generate expected sizes.
- The temp directory remains writable after restart or deployment.
- No orphaned files or permission errors accumulate.
A visible symptom disappearing is not enough. Close the incident only when the original failing action, the surrounding business journey and the relevant logs all agree that the fault is gone.
WP REPAIR INCIDENT STANDARD
How to narrow the fault without guessing
Changing uploads permissions cannot fix a temporary-directory failure. The effective upload_tmp_dir, system temp path, free space and PHP user identify the broken layer.
Check the effective upload_tmp_dir in the web PHP runtime.
Verify the directory exists, has free space and is writable by the PHP-FPM user.
Inspect open_basedir or container mounts that may hide the configured path.
Test a small upload while watching the PHP error log.
What must be verified
- Media uploads complete and generate expected sizes.
- The temp directory remains writable after restart or deployment.
- No orphaned files or permission errors accumulate.
Official technical sources
Continue the diagnosis
This guide explains the diagnosis. If the site is affected now, the intervention should preserve a rollback path and verify the real business journey.
See the emergency repair service →ABOUT THIS SYMPTOM
Frequently asked questions about this guide.
Will fixing permissions on wp-content/uploads resolve this error?+
No. This error occurs at the PHP temporary-directory stage, before the file ever reaches wp-content/uploads, so uploads folder permissions are not the relevant layer. The fix is to check upload_tmp_dir, its existence, free space, and ownership instead.
Could this happen even if the temp directory exists and has free space?+
Yes. Restrictions like open_basedir, SELinux, AppArmor, or a container boundary can block PHP from accessing a temp path that otherwise exists and has room. Inspecting these access-control layers is necessary when the directory itself looks fine.
Is a world-writable temporary directory an acceptable fix?+
No. A world-writable shared directory without sticky-bit and isolation controls is unsafe because temporary uploads can contain sensitive customer data. Set correct ownership and narrow permissions for the PHP-FPM user instead of opening access broadly.
Why might this suddenly appear after a server migration when uploads worked fine before?+
Deployments or host changes can leave the configured temp path missing, unmounted in a container, or owned by a different user than the new PHP-FPM process expects. Checking the effective upload_tmp_dir in the current runtime — not just the old configuration — identifies this quickly.