Legacy support, updated
Fix PHP touch(): Utime failed: Permission denied
The PHP process cannot update the file timestamp or create the requested file. Fix ownership and the smallest required directory or file permission for the web runtime; do not make the whole application world-writable.
Identify the exact failing path
- Read the complete warning and record the file path. A relative path can resolve differently under a web request than under command-line PHP.
- Confirm whether the file already exists and which user and group own the file and each parent directory.
- Identify the user running PHP-FPM or the web server. Testing as your SSH account can succeed while the web request still fails.
Linux path inspection
ls -ld /path/to/parent /path/to/file
namei -l /path/to/file
Apply the narrowest safe correction
- Prefer correct owner or group membership for the application’s intended writable directory.
- Grant write access only where the application creates or updates files. WordPress core and plugin code should not be broadly writable by the web process.
- Account for SELinux, container mounts, read-only filesystems, network-storage rules, and hosting-provider controls when Unix mode bits look correct.
- Ask the hosting provider to make the change when you do not control the runtime user or filesystem policy.
Verify the result
Retry the same operation through the website, confirm that the expected file was created or updated, and review the PHP error log for related imagejpeg(), copy(), or path failures. Remove any temporary diagnostic file when the check is complete.