【问题标题】:Installing PHP 5.4 on Ubuntu在 Ubuntu 上安装 PHP 5.4
【发布时间】:2017-08-29 20:15:03
【问题描述】:

所以我需要在 ubuntu-16.04-server-amd64 上安装 PHP 5.4。其他一些线程建议

  • sudo add-apt-repository ppa:ondrej/php5-oldstable
  • sudo apt-get 更新
  • sudo apt-get install -y php5

但这些不起作用,因为更新时出现错误。

Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

为此推荐的行动方案是什么?

【问题讨论】:

标签: php linux ubuntu php-5.4


【解决方案1】:

你能用docker吗?另一种方式只有从源代码编译php

docker run --name app --net mysql_net -d -p 8080:80 \ -v /host/to/path/app:/var/www/app/ \ -v /host/to/path/config_apache:/etc/apache2/sites-enabled/ \
romeoz/docker-apache-php:5.4

/host/to/path/app - 应用路径和 /host/to/path/config_apache - apache 配置的路径(通过此链接进行配置的基本文件 https://github.com/romeOz/docker-apache-php/blob/master/5.4/configs/app.conf

然后为mysql创建容器

docker run --name db --net mysql_net -d \ -v /host/to/path/data:/var/lib/mysql\romeoz/docker-mysql:5.5

/host/to/path/data - 你的数据库数据的路径

现在您可以通过主机db 使用数据库了 应用程序可用 http://localhost:8080

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-10
    • 2016-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-06
    • 2013-01-08
    相关资源
    最近更新 更多