Docker容器中的PHP intl扩展 [英] PHP intl extension in Docker container

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

问题描述

我正在尝试将intl PHP扩展加载到我的Docker容器中,但似乎无法正常工作.

I'm trying to load the intl PHP extension in my Docker container, but it doesn't seem to work.

已经尝试过此 https://github.com/docker-library/php/issues/57 ,但我仍然收到相同的错误消息:

Have already tried this https://github.com/docker-library/php/issues/57 but I still get the same error message:

configure: error: in `/usr/src/php/ext/intl':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details

我的Docker文件如下所示:

My Docker file looks like this:

RUN apt-get -y update \
&& apt-get install -y libicu-dev\
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl

它是从php:fpm加载的

and it's loading from php:fpm

有没有人经历过这个问题并得到解决?真让我发疯.

Have anyone gone through this and got to solve the problem? It's getting me nuts.

推荐答案

似乎缺少某些要求.下面的代码段对我有用:

It seems some requirements are missing. The snippet below worked for me:

ARG PHP_VERSION=5.6
FROM php:${PHP_VERSION}-fpm-jessie

apt-get install -y zlib1g-dev libicu-dev g++ \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl

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

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