Last active
December 15, 2023 04:10
-
-
Save daaru00/96cc6364802869d59ee4c53eccec5b31 to your computer and use it in GitHub Desktop.
Reset PHP OPcache cache from command line
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
#!/bin/bash | |
WEBDIR=/var/www/html/ | |
RANDOM_NAME=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13) | |
echo "<?php opcache_reset(); ?>" > ${WEBDIR}${RANDOM_NAME}.php | |
curl http://localhost/${RANDOM_NAME}.php | |
rm ${WEBDIR}${RANDOM_NAME}.php | |
echo "cache reset" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment