孙肖宁

Ubuntu16.04安装php5.6以及php5.6与php7.0 的切换
安装php5.6添加源sudo add-apt-repository ppa:ondrej/php 安装php...
扫描右侧二维码阅读全文
04
2017/11

Ubuntu16.04安装php5.6以及php5.6与php7.0 的切换

安装php5.6

添加源

sudo add-apt-repository ppa:ondrej/php 

安装php5.6

sudo apt-get update  
sudo apt-get install php5.6  
sudo apt-get install libapache2-mod-php5.6  
sudo apt-get install php5.6-mysql php5.6-mbstring php5.6-mcrypt php5.6-xml  

版本切换

1.从PHP 5.6 切换到 PHP 7.0

sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
update-alternatives --set php /usr/bin/php7.1

2.从PHP7.0切换到5.6

sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6
Last modification:September 17th, 2018 at 10:32 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment