Created
September 21, 2021 11:00
-
-
Save noweh/79f6ea1fa7abecfa90aba09c20ad1090 to your computer and use it in GitHub Desktop.
Laravel refresh cache in shell + clear OPCACHE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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