DEV Community

Tr.Ra
Tr.Ra

Posted on

1 1

Switch PHP version on linux

You can list all loaded Apache modules with apache2ctl -M

this method is work fine
you can ls /usr/bin/php* to see how many php version you have and use this command switch to it

update-alternatives --set php /usr/bin/php7.4
Enter fullscreen mode Exit fullscreen mode

this method sometime not work like u expected

$ sudo a2dismod php7.1
$ sudo a2enmod php5.6
$ sudo service apache2 restart
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay