如何在 ubuntu 桌面 12.04 上安装 php 5.4 install?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18003819/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:46:52  来源:igfitidea点击:

how to install php 5.4 install on ubuntu desktop 12.04?

phpubuntu

提问by Igor Khromov

I try to install php5 package with a specific version 5.4.

我尝试安装特定版本 5.4 的 php5 包。

But I have problem and can not solve it myself. When I try to install :

但我有问题,无法自己解决。当我尝试安装时:

"apt-get install php5=5.4.9-4ubuntu2"

It returns me an error:

它返回一个错误:

E: Version '5.4.9-4ubuntu2' for 'php5' was not found.

E:未找到“php5”的“5.4.9-4ubuntu2”版本。

How can I solve this task?

我该如何解决这个任务?

回答by Rao

Add this ppa

添加这个ppa

sudo add-apt-repository ppa:ondrej/php

Then update and upgrade, upgrade will automatically install latest 5.4.x version of php

然后更新升级,升级会自动安装最新的5.4.x版本的php

sudo apt-get update
sudo apt-get upgrade

Followed by,

其次是,

sudo apt-get install -y php5.6

sudo apt-get install -y php5.6

or

或者

sudo apt-get install -y php7.2

sudo apt-get install -y php7.2

depending on which version of PHP you want installed.

取决于您要安装的 PHP 版本。



To install through Ubuntu software centre

通过 Ubuntu 软件中心安装

php5Install php5

php5安装php5

Ref: https://askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1

参考:https: //askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1

回答by Prahlad Yeri

If anyone is still looking to install php 5.4 and wants to create a stand-alone install of php 5.4 from source, this is how do do it:

如果有人仍在寻找安装 php 5.4 并希望从源代码创建 php 5.4 的独立安装,请执行以下操作:

Create a folder named php-5.4 in your local home directory like ~/programs/php-5.4. Then execute below commands from it through CLI.

在本地主目录中创建一个名为 php-5.4 的文件夹,如 ~/programs/php-5.4。然后通过 CLI 从它执行以下命令。

  sudo apt-get install gcc libmysqlclient-dev libxml2-dev
  wget --trust-server-names http://museum.php.net/php5/php-5.4.15.tar.bz2
  tar xjf php-5.4.15.tar.bz2
  cd php-5.4.15
  ./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql
  make install
  cd -

Replace 5.4.15 with the latest old-stable version of php. Refer thisGoogle appengine developer page for more details.

将 5.4.15 替换为 php 的最新旧稳定版本。有关更多详细信息,请参阅Google appengine 开发人员页面。

edit

编辑

Updated the new location for php 5.4.

更新了 php 5.4 的新位置。