在Ubuntu 16.04 Xenial和apache上安装php 5.3或5.4 [英] Install php 5.3 or 5.4 on Ubuntu 16.04 Xenial and apache
问题描述
我想在Ubuntu 16.04 Xenial和Apache上安装php 5.3或5.4.
一个教程指出我可以使用PPA,但它们并不能帮助我满足我的需求.
I want to Install php 5.3 or 5.4 on Ubuntu 16.04 Xenial and Apache.
A tutorial points me to use PPA but they are not helping me in what I need.
我知道PHP 5.3和4已过时,但是我在项目中需要它,这可能吗?如果是,那么请教我如何逐步使用Apache2.
I know that PHP 5.3 and 4 are obsolete but I need this for a project and is this possible? If yes then please teach me how in a step by step procedure with Apache2.
推荐答案
Before installing PHP 5.4 you need to read this notice:
对PHP 5.4的安全支持已经结束.您正在使用此存储库,但知道可能存在并且可能是未修复的安全漏洞.请升级到主存储库中的PHP 5.6或PHP 7.0:
ppa:ondrej/php
了解风险之后,要安装PHP 5.4,请将PPA添加到您的 sources.list
:
After understanding the risks , to install PHP 5.4 ,add the PPA to your sources.list
:
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
安装:
sudo apt-get install -y php5
为了安全起见,可以按以下方式安装PHP 5.6版本:
To be safe , the PHP 5.6 version can be installed as follows:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
更新
PHP 5.6之前的所有版本都是不受支持
All version prior to PHP 5.6 are unsupported
此页面列出了每个不受支持的 PHP 分支的生命周期结束日期.如果您使用的是这些版本,强烈建议您升级到当前版本,因为使用较旧的版本可能会使您暴露在较新版本的PHP中已修复的安全漏洞和错误.
This page lists the end of life date for each unsupported branch of PHP. If you are using these releases, you are strongly urged to upgrade to a current version, as using older versions may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP.
这篇关于在Ubuntu 16.04 Xenial和apache上安装php 5.3或5.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!