红联Linux门户
Linux帮助

在Ubuntu 16.04中从PHP 7降级到PHP 5.6

发布时间:2017-01-07 10:36:41来源:linux网站作者:Primzahl
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
 
本文永久更新地址:http://www.linuxdiyf.com/linux/27596.html