Last active
June 19, 2023 20:44
-
-
Save vjandrea/132a15186fa0193fb764 to your computer and use it in GitHub Desktop.
Change php cli version in plesk
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/sh | |
printf "Switching php to version 5.6 with symlinks.\n" | |
printf "Press any key to continue...\n" | |
read CONTINUE | |
printf "Creating backups..." | |
# Backup original binaries | |
mv /usr/bin/php /usr/bin/php.backup | |
mv /usr/bin/php-cgi /usr/bin/php-cgi.backup | |
# mv /usr/bin/phpize /usr/bin/phpize.backup | |
printf " done.\n\n" | |
printf "Creating symlinks..." | |
# Create symlinks to the plesk ones | |
ln -s /opt/plesk/php/5.6/bin/php /usr/bin/php | |
ln -s /opt/plesk/php/5.6/bin/php-cgi /usr/bin/php-cgi | |
# ln -s /opt/plesk/php/5.6/bin/phpize /usr/bin/phpize | |
printf " done.\n\n" | |
printf "Process completed.\n" | |
printf "PHP version is:\n" | |
php -v | |
printf "\nand PHP binary path is:\n" | |
which php | |
printf "\n\n" |
This needs to be done with Root right? How do I obtain roots credentials from Plesk?
I've used this on several servers and all works ok except one seems to keep reverting back to an older version now and again, I assume some plesk update is overwriting the change, anyone know how to stop that from happening?
Thanks it work for me too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you are a life saver