Skip to content

Instantly share code, notes, and snippets.

@MehulBawadia
Created February 25, 2022 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MehulBawadia/c9a7cac1a8cabfd5ba5791273d14d422 to your computer and use it in GitHub Desktop.
Save MehulBawadia/c9a7cac1a8cabfd5ba5791273d14d422 to your computer and use it in GitHub Desktop.
Switching PHP Versions
#!/bin/bash
# switch php version
# All at Once - Switching from PHP 7.4 to 8.0
sudo a2dismod php7.4 && sudo a2enmod php8.0 && sudo service apache2 restart
sudo update-alternatives --config php
[Choose appropriate number] for php8.0 (Generally is 6)
sudo service apache2 restart
# All at Once - Switching from PHP 8.0 to 7.4
sudo a2dismod php8.0 && sudo a2enmod php7.4 && sudo service apache2 restart
sudo update-alternatives --config php
[Choose appropriate number] for php7.4 (Generally is 5)
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment