简体   繁体   English

在 Alpine Linux 中安装特定版本的 PHP

[英]Install specific version of PHP in Alpine Linux

I am trying to install PHP v8.0.2 on an Alpine Linux, but I get the following message:我正在尝试在 Alpine Linux 上安装 PHP v8.0.2,但收到以下消息:

apk add php8=8.0.2
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
  php8-8.0.6-r0:
    breaks: world[php8=8.0.2]

Is there any way I can get it to install?有什么办法可以安装吗?
If I just do apk add php8 it adds version 8.0.6 , but there is an issue on that version that breaks my site.如果我只是做apk add php8它会添加版本8.0.6 ,但是该版本的问题会破坏我的网站。

Any help would be greatly appreciated任何帮助将不胜感激

It is impossible via apk, as the Alpine Linux team are not keeping "older versions" in their current repositories (as stated here (gitlab.alpinelinux.org) and here (stschindler.medium.com) )通过 apk 是不可能的,因为 Alpine Linux 团队没有在他们当前的存储库中保留“旧版本”(如此处 (gitlab.alpinelinux.org)此处 (stschindler.medium.com) 所述

So you have to go the way Richard Wan proposed and build it from source, if you can't make your site running with php 8.0.6 or 7.4.19.因此,如果您不能使您的站点使用 php 8.0.6 或 7.4.19 运行,您必须按照 Richard Wan 建议的方式 go 并从源代码构建它。

maybe u can install php from source, since it's hard to find a specific version of php and install that using apt-get or yum install.也许您可以从源代码安装 php,因为很难找到 php 的特定版本并使用 apt-get 或 yum install 安装。 And here is the source code of php 8.0.2: source code of php 8.0.2这里是 php 8.0.2 的源代码: php 8.0.2 的源代码

And the following article will give u some instructions of how to do that.It is php 7 installation, but the method is kinda same.下面的文章将给你一些如何做到这一点的说明。它是 php 7 安装,但方法有点相同。 Here is the articlel: https://blacksaildivision.com/php-install-from-source这是文章l: https://blacksaildivision.com/php-install-from-source

The PHP official Dockerhub page has version tags for official PHP versions in various flavors. PHP 官方 Dockerhub页面有各种风格的官方 PHP 版本的版本标签。

For the PHP 8.0.2 Alpine image, you could use php:8.0.2-alpine3.12 as your base image, instead of alpine:3.13 .对于 PHP 8.0.2 Alpine 映像,您可以使用php:8.0.2-alpine3.12作为基础映像,而不是alpine:3.13

For other PHP 8.0.2 Alpine 3.12 based images, see:对于其他基于 PHP 8.0.2 Alpine 3.12 的映像,请参阅:
https://hub.docker.com/_/php?tab=tags&page=1&ordering=last_updated&name=8.0.2 https://hub.docker.com/_/php?tab=tags&page=1&ordering=last_updated&name=8.0.2

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

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