Skip to content

Instantly share code, notes, and snippets.

@noweh
Created September 21, 2021 11:00
Show Gist options
  • Save noweh/79f6ea1fa7abecfa90aba09c20ad1090 to your computer and use it in GitHub Desktop.
Save noweh/79f6ea1fa7abecfa90aba09c20ad1090 to your computer and use it in GitHub Desktop.
Laravel refresh cache in shell + clear OPCACHE
#!/usr/bin/env bash
php -d memory_limit=-1 artisan cache:clear
php -d memory_limit=-1 artisan config:clear
php -d memory_limit=-1 artisan config:cache
php -d memory_limit=-1 artisan route:clear
php -d memory_limit=-1 artisan route:cache
APP_URL=$(grep APP_URL .env | cut -d '=' -f2)
APP_ENV=$(grep APP_ENV .env | cut -d '=' -f2)
if [ $APP_ENV != "local" ]
then
php ~/cachetool.phar opcache:reset --fcgi=127.0.0.1:9073
printf "\033[1;32mOPCACHE cleaned.\033[0m\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment