ubuntu16.04 系统源自带是7.0的,如何降级安装PHP 5.6呢?
apt-get install -y language-pack-en-base
LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
add-apt-repository ppa:ondrej/php
apt-get update
apt-cache search php5
apt-get install php5.6-common
apt-get install libapache2-mod-php5.6
如果需要解析xml apt-get install php5.6-xml
Warming:
apt-get install libapache2-mod-php5.6
libapache2-mod-php5.6: php7.0 module already enabled, not enabling PHP 5.6
apt-get install libapache2-mod-php5.6
php7.0 module already enabled, not enabling PHP 5.6update-alternatives --set php /usr/bin/php5.6
解决方法:
update-alternatives --set php /usr/bin/php5.6
php -v
PHP 5.6.29-1+deb.sury.org~xenial+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies