Ubuntu服务器更改PHP版本 7.2 to 7.0, 7.4 to 7.3, 7.4 to 7.2, 7.3 to 7.2, 7.3 to 7.1
command and step by step guide, tutorial
- 输入以下代码查看本机php版本
php -v - sudo add-apt-repository ppa:ondrej/php
- sudo apt-get update
- sudo apt-get install php7.0
- sudo apt-get install php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-mbstring php7.0- mcrypt php7.0-zip php7.0-fpm php7.0-intl php7.0-simplexml
- sudo a2dismod php7.2
- sudo a2enmod php7.0
- sudo service apache2 restart
- sudo update-alternatives –set php /usr/bin/php7.0
- sudo update-alternatives –set phar /usr/bin/phar7.0
- sudo update-alternatives –set phar.phar /usr/bin/phar.phar7.0
- sudo update-alternatives –set phpize /usr/bin/phpize7.0
- sudo update-alternatives –set php-config /usr/bin/php-config7.0
- Check current Version of PHP by using command