Last active
August 1, 2018 20:31
-
-
Save ladyjer/5a2da3fcc1da3a5bc7f7 to your computer and use it in GitHub Desktop.
Switch between PHP5 and PHP7 on Linux
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
sudo service apache2 stop | |
sudo a2dismod php5 | |
sudo a2enmod php7 | |
sudo service apache2 start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you want to switch between 7 and 5 you'll need something like the following to make sure all the libs are in sync
rm /usr/lib/php
ln -fs /usr/lib/php5 /usr/lib/php
rm /etc/php
ln -fs /etc/php5 /etc/php
rm /usr/bin/php
ln -fs /usr/bin/php5 /usr/bin/php
rm /usr/share/php
ln -fs /usr/share/php5 /usr/share/php
a2dismod php7.0
a2enmod php5
service apache2 reload