在Docker容器中为PHP启用Soap [英] Enable soap for php in docker container

查看:365
本文介绍了在Docker容器中为PHP启用Soap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法使用php Docker安装程序。

I have been unable to get soap to work with my php Docker setup.

我正在将Docker CE用于Windows 18.03.1-ce-win65(17513)。 PHP版本7.2.3

I am using Docker CE for Windows Version 18.03.1-ce-win65 (17513). PHP version 7.2.3

我尝试从容器 apt-get install php-soap 中运行导致
正在阅读软件包列表...完成

构建依赖关系树

阅读状态信息...完成
*
软件包php-soap是由以下人员提供的虚拟软件包:
* php7.0-soap 7.0.27 -0 + deb9u1 [非候选版本] *

I've tried running from inside the container apt-get install php-soap which results in Reading package lists... Done
Building dependency tree
Reading state information... Done
* Package php-soap is a virtual package provided by: * php7.0-soap 7.0.27-0+deb9u1 [Not candidate version]*

E:软件包'php-soap'没有安装候选版本

E: Package 'php-soap' has no installation candidate

运行 docker-php-ext-install soap
会导致错误配置:错误:找不到libxml2。请检查您的libxml2安装。

Running docker-php-ext-install soap results in the error configure: error: libxml2 not found. Please check your libxml2 installation.

但是,当查看php信息时,我会看到以下内容:
libxml2版本=> 2.9.4

However when looking at php info I see the following: libxml2 Version => 2.9.4

推荐答案

您将需要将libxml2-dev作为dockerfile的一部分进行安装,该映像将保留在最小数量且不会包括每个模块所需的所有位。尽管映像可能具有主程序包,但-dev程序包包括编译依赖该程序包的其他模块所需的组件...

You will need to install libxml2-dev as part of your dockerfile, the image is kept to a minimum and doesn't include all of the bits needed by every module. Although the image may have the main package, the -dev package includes the components needed to compile other modules which rely on it...

RUN apt-get update && \
    apt-get install -y libxml2-dev

(来自 https://github.com/docker-library/php/issues/315

这篇关于在Docker容器中为PHP启用Soap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆