Set web folder ownership to www-data

Recursively give Apache ownership of a directory so PHP can write to cache/uploads.

Changes ownership of a web directory to the www-data user and group that Apache/Nginx runs as. Required for PHP to write files (logs, cache, uploads) within the web root.

When you need this: After deploying files to a web root directory, or when PHP throws permission-denied errors writing files.

Variables

Command


        
2 views 0 copies
Log in to rate
Log in to save

Free account — save snippets into your own collections.