简体   繁体   English

如何使用 ubuntu 16 安装 php 5.4??

[英]how to install php 5.4 with ubuntu 16??

I have install LAMP stack on ubuntu 16, I got php 7.我已经在 ubuntu 16 上安装了 LAMP 堆栈,我得到了 php 7。

I want to downgrade it to php 5.4 .我想将它降级到 php 5.4 。 what command should I use to remove php 7 and install php 5.4 in my ubuntu 16?我应该使用什么命令来删除 php 7 并在我的 ubuntu 16 中安装 php 5.4?

try this试试这个

sudo apt-get purge php* sudo apt-get 清除 php*

then那么

sudo apt-get install php5.4 php5.4-gettext php5.4-common须藤 apt-get 安装 php5.4 php5.4-gettext php5.4-common

First, remove LAMP from your Ubuntu.首先,从您的 Ubuntu 中删除 LAMP。 Then, use the following:然后,使用以下内容:

sudo apt-get update
sudo apt-get install apache2 php5 mysql-server mysql-client php5-mysql //install php 5.3
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get remove php5 //remove php 5.3
sudo apt-get update
sudo apt-get install php5 //install php 5.4

First you must install PHP 5.4 (if you have not already done so):首先,您必须安装 PHP 5.4(如果您还没有安装):

sudo apt-get install php5-fpm php5-mysql

And then:然后:

Apache:阿帕奇:

sudo a2dismod php7.0 ; sudo a2enmod php5.4 ; sudo service apache2 restart

CLI:命令行界面:

sudo update-alternatives --set php /usr/bin/php5.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM