Skip to content

Instantly share code, notes, and snippets.

@epicsagas
Last active December 17, 2019 04:08
Show Gist options
  • Save epicsagas/b767e61edb6db6dfb3b603ac60a0ed8e to your computer and use it in GitHub Desktop.
Save epicsagas/b767e61edb6db6dfb3b603ac60a0ed8e to your computer and use it in GitHub Desktop.
Fix laravel directory permission
!#/bin/bash
# commands are from https://tecadmin.net/laravel-file-permissions/
user=$1
group=$2
dir=$3
chown -R $1:$2 $3;
find $dir -type f -exec chmod 644 {} \;
find $dir -type d -exec chmod 755 {} \;
cd $dir;
chgrp -R $user storage bootstrap/cache;
chmod -R ug+rwx storage bootstrap/cache;
usermod -a -G $user $group;
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment