You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to create cache directory (permission denied) #361
/var/www is www-data's home directory. Since you are using sudo -u www-data to run a command as that user, this sets HOME to that user's home.
WP-CLI uses the $HOME/.wp-cli/cache directory for caching all sorts of things. Since WP-CLI v3.0.0 (wp-cli/wp-cli#6424), it caches checksums to speed up later checks. The check itself isn't affected by this warning, the cache just gets skipped.
To fix this, either create that cache directory, or point WP-CLI to use a different directory, e.g. using sudo -u www-data env WP_CLI_CACHE_DIR=/tmp/wp-cli-cache wp core verify-checksums
We'll consider turning this particular warning into a debug message in the meantime, but generally speaking I really recommend setting up that cache directory.
changed the title [-]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for Wordpress installation in a different directory[/-][+]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for WordPress installation in a different directory[/+]on Dec 2, 2026
changed the title [-]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for WordPress installation in a different directory[/-][+]Failed to create cache directory (permission denied)[/+]on Dec 2, 2026
Activity
swissspidy commentedon Dec 2, 2026
Thanks for the report!
/var/wwwiswww-data's home directory. Since you are usingsudo -u www-datato run a command as that user, this setsHOMEto that user's home.WP-CLI uses the
$HOME/.wp-cli/cachedirectory for caching all sorts of things. Since WP-CLI v3.0.0 (wp-cli/wp-cli#6424), it caches checksums to speed up later checks. The check itself isn't affected by this warning, the cache just gets skipped.To fix this, either create that cache directory, or point WP-CLI to use a different directory, e.g. using
sudo -u www-data env WP_CLI_CACHE_DIR=/tmp/wp-cli-cache wp core verify-checksumsWe'll consider turning this particular warning into a
debugmessage in the meantime, but generally speaking I really recommend setting up that cache directory.[-]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for Wordpress installation in a different directory[/-][+]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for WordPress installation in a different directory[/+]mvl22 commentedon Dec 2, 2026
Doh, of course, yes.
Agree having this silently work without a cache is sensible.
Will a
debugmessage be excluded when using--quiet(as we are)?swissspidy commentedon Dec 2, 2026
Yes debug messages are excluded by default (even without
--quiet) unless you explicitly pass--debug[-]Failed to create directory '/var/www/.wp-cli/cache/': mkdir(): Permission denied - for WordPress installation in a different directory[/-][+]Failed to create cache directory (permission denied)[/+]