Fix log permissions
Skill choutos/agent-skills-spec/examples/fix-log-permissions
Open specification for packaging procedural knowledge for AI agents. Framework-agnostic SKILL.md format.
npx -y skills add choutos/agent-skills-spec --skill fix-log-permissionsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Fix Laravel log file permission errors after deployment. Use when seeing "UnexpectedValueException: Permission denied" for storage/logs/laravel.log, or after any deployment that may change file ownership. Triggers on: laravel, log permissions, www-data, storage/logs, permission denied.
SKILL.md
1.0 KB, as published. Nobody here has run it
Fix Laravel Log Permissions
Symptoms
UnexpectedValueException: .../storage/logs/laravel.log Permission denied- Application returns 500 errors after deployment
- Log file owned by
rootinstead ofwww-data
Fix
# Fix ownership
sudo chown -R www-data:www-data /var/www/storage/logs/
# Restart PHP-FPM (adjust version as needed)
sudo systemctl restart php8.2-fpm
Or use the script: scripts/fix-perms.sh <ssh-host>
Root Cause
Deployment runs as root, creating or modifying log files with root ownership. The web server (www-data) then can't write to them.
Prevention
Add to post-deploy hook:
chown -R www-data:www-data /var/www/storage/logs/