How can I change php-cli version on Ubuntu 14.04?

后端 未结 7 898
面向向阳花
面向向阳花 2020-12-04 09:41

I am new to using Linux and I broke some php settings while tampering.

If I execute a php script containing: phpinfo(); it shows the php versions as 5.

7条回答
  •  时光取名叫无心
    2020-12-04 10:06

    From PHP 7.1 => PHP 5.6

    sudo update-alternatives --set php /usr/bin/php5.6
    

    From PHP 5.6 => PHP 7.1

    sudo update-alternatives --set php /usr/bin/php7.1
    

    You can change the versions as you want.

    You can check this tutorial

    Regards!!

提交回复
热议问题