如何在Ubuntu16.10/16.04和14.04上将PHP7.0降级到PHP5.6

Discuz 不支持PHP7,最好使用PHP5.X版本
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

安装php5.6sudo apt-get updatesudo apt-get install php5.6安装扩展sudo apt-get install php5.6-gdsudo apt-get install php5.6-mysql安装Apache2sudo apt install apache2sudo apt-get install libapache2-mod-php5.6安装MySQL//sudo apt install mysql-server php5.6-mysql    root root0x0
sudo apt install mysql-server php5.6-mysql sudo apt-get install mysql-clientmysql_secure_installation
最后非常重要的,切换php7 到php5
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo service apache2 restart
sudo update-alternatives –set php /usr/bin/php5.6
还可以安装curl
sudo apt-get install php5.6-curl
———————
参考:
1. https://blog.csdn.net/chencaw/article/details/78784857?utm_source=copy
2. https://www.zhihu.com/question/45999546/answer/100165171

欢迎关注我的微信公众号:

 

如无特殊说明,文章均为本站原创,转载请注明出处!

发表评论

邮箱地址不会被公开。 必填项已用*标注