Skip to content

Instantly share code, notes, and snippets.

@ganey
Forked from vjandrea/phpversion.sh
Last active October 31, 2019 09:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ganey/2556bdab639410e29aa9b2a6f0b9a824 to your computer and use it in GitHub Desktop.
Save ganey/2556bdab639410e29aa9b2a6f0b9a824 to your computer and use it in GitHub Desktop.
Change php cli version in plesk
#!/bin/sh
printf "Switching php to version 7.1 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/7.1/bin/php /usr/bin/php
ln -s /opt/plesk/php/7.1/bin/php-cgi /usr/bin/php-cgi
# ln -s /opt/plesk/php/7.1/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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment