-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-php-ext-install intl fails #57
Comments
That is as expected. We only install the minimal requirement to run php; any dependencies of extra modules you add would need to be added as well. Some packages could just be required for building the new module and could then be combined in one RUN line so that an |
Adding g++ seems reasonable though, IMO, since it's needed to compile some |
Thanks for the response, I would say from an outsiders point of view that the name "docker-php-ext-install" to me at least indicates that the script is installing the extension and any dependencies. The issue is that unless you know which dependencies are required to install an extension you end up running it several times to find out where it fails and then google the error :-) . Im not suggesting that you should add every dependency under the sun to the container, I am just explaining that the current implementation has some confusion to it. I don't like describing a problem unless I can suggest something to resolve it although this is a difficult one. So here are some suggestions:
I am just trying to think of ways of removing barriers for people who want to use the image but then get stuck when they need to install the dependencies. If I can help at all with the documentation for docker-php-ext-install let me know as I only stumbled upon this by accident reading the other issues. |
I'm not sure but after facing the same problem (solved in the same way @robbydooo did) I've realized that Symfony Standard Edition (through its I've found some references to What do you think guys? |
+1 for intl available by default. |
Random thrown in suggestion, why include a manifest of extensions in addition to the script that provides preinstall and postinstall commands (g++ isnt likely to be needed AFTER intl is installed so may as well remove it and clean up after install) |
+1 same fail. And +1 to enable intl by default ! |
I don't think it would be a good idea to enable intl be default. I use docker for development only, so I might see things from a different perspective, but I like having to deal with my dependencies. It allows me to have a good idea of what has to be installed at the production environment. Silently installed dependencies could lead to a missing dependency on production. |
Even if it's not included by default, it would be cool if we provide an example of a way to install it (docment an example Dockerfile or something). |
A working example:
|
I agree that it is not the requirement to install by default as such but I would expect docker-php-ext-install/docker-php-ext-configure to not die in the current way. To me it doesn't make sense to have a tool that should install libraries fail because the required dependancies are not installed. I would expect it to at least throw a useful error (E.g run apt get install XYZ). Maybe there should be another script docker-php-install-ext-dependencies that docker-php-ext-install could call if they are not installed to handle this issue. Based on the required extensions it could build a list of dependencies to install and install them. You could then add a flag to the docker-php-ext-install such as --install-dependencies to auto handle this. What do you think? |
I agree it's not easy to know what went wrong and which package to install in order to get an extension to work. But It should be the php (pecl) docs role, not |
Same problem from my side. |
I just ran into this issue, i'm just wondering if we shouldn't just list the available extensions and what dependencies need to be installed to have it compile. |
Agreed, +1 intl |
In case this helps anyone else, @docteurklein's Dockerfile config didn't quite work for me (Docker Toolbox 1.12.0 on Windows 10) but it did successfully install intl when I tweaked it a tiny bit:
|
Symfony recommends Intl, so it'd be quite nice to have intl in default container setup |
Guys, I really don't believe one have to install |
@mikemix you guess or you're sure? Pretty sure I put g++ for a reason, I wouldn't include it for the fun of it :) |
+1 enable intl by default |
Well, at least this thread is one of the top results when you google the error message. Thanks guys. |
+1 enable intl by default |
+1 to enable intl by default |
how is it for alpine? if i may |
@cordoval Per the gitHub Dockerfile for 7.2-rc-alpine intl is not enabled. |
i just wanted a solution for alpine not force any intl onto the core. I resolved it. |
@cordoval how did you solve this, please share with the community your solution? |
ok i will paste it here:
if you guys find improvements to this let me know so i can retrogain as well 👍 |
@mikemix @docteurklein FROM php:7.2-rc-apache
RUN apt-get -y update \
&& apt-get install -y libicu-dev\
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl works fine for me. |
I still have an issue with the image php:7.2-apache. @mrgrain I don't have any error with your solution during the build, but intl doesn't seem to be installed or activated properly after the build is completed ( Does anyone manage to make it work on the debian stretch image? |
@nicogommen I'm not able to reproduce: 😕 $ docker pull php:7.2-apache
7.2-apache: Pulling from library/php
Digest: sha256:b2cc1f9dead1c87b60b0961b0d163a8a4c0a028f01138d8a8225f2f946948113
Status: Image is up to date for php:7.2-apache
$ docker run -it --rm php:7.2-apache bash
root@4fe792fb131a:/var/www/html# apt-get update -qq
root@4fe792fb131a:/var/www/html# apt-get install -yqq libicu-dev > /dev/null
debconf: delaying package configuration, since apt-utils is not installed
root@4fe792fb131a:/var/www/html# docker-php-ext-install intl > /dev/null
/usr/src/php/ext/intl/idn/idn.c: In function 'php_intl_idn_to':
/usr/src/php/ext/intl/idn/idn.c:227:4: warning: 'uidna_IDNToASCII_57' is deprecated [-Wdeprecated-declarations]
converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
from /usr/include/unicode/ptypes.h:50,
from /usr/include/unicode/umachine.h:44,
from /usr/include/unicode/utypes.h:36,
from /usr/include/unicode/uidna.h:20,
from /usr/src/php/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:673:1: note: declared here
uidna_IDNToASCII( const UChar* src, int32_t srcLength,
^
/usr/src/php/ext/intl/idn/idn.c:229:4: warning: 'uidna_IDNToUnicode_57' is deprecated [-Wdeprecated-declarations]
converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/unicode/platform.h:23:0,
from /usr/include/unicode/ptypes.h:50,
from /usr/include/unicode/umachine.h:44,
from /usr/include/unicode/utypes.h:36,
from /usr/include/unicode/uidna.h:20,
from /usr/src/php/ext/intl/idn/idn.c:28:
/usr/include/unicode/uidna.h:720:1: note: declared here
uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
^
root@4fe792fb131a:/var/www/html# php -i | grep -i intl
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0
intl.use_exceptions => 0 => 0
root@4fe792fb131a:/var/www/html# |
Hi @tianon |
For those who care about having the latest icu data available, it's rather straight forward to compile it in. See an example here: https://github.com/jakzal/docker-symfony-intl/blob/master/7.2/61.1/Dockerfile
I wouldn't use those images directly, as they're meant to provide various icu versions for Symfony development. I'd rather replicate similar steps in your own images.
|
I got same error on
|
Intl should not be installed by default. also if some frameworks like Cake or Symfony (that I'm using and that is the reason why I landed on this issue) require it, it is not a mandatory package. For example, with Symfony, if you develop a CLI app, there are 99% of possibilities you don't need the Intl extension. And also if you develop a web app, the Intl extension is only required by validators: So, my point is to provide clear and definitive examples of how to install the Intl ext, but not including it by default as it is not always required. My 2 cents. |
+1 to enable intl by default |
Don't put anything by default. One can install everything easily. The image should be as skinny as possible. Also please don't create (up/down)vote posts, stick to emoji please. Installation is really easy:
|
Hi, Is this configuration still working for you? I'm using php:7.1-fpm as my base image and when I follow the installation of intl I get this warning: /usr/src/php/ext/intl/idn/idn.c: In function 'php_intl_idn_to': I tried with zlib1g-dev libicu-dev g++ as @Tocacar suggested and also the simple install by @mikemix. Both generate this warning. |
I just built it against |
@anacicconi on some platforms with the most recent ICU versions I had to do |
Upstream has an RFC to track the IDNToASCII (idna) deprecation: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003 It looks like work to implement the deprecation is already underway but hasn't been released yet. php/php-src@8a4c2f1 If @jakzal's workaround fails in later ICU releases (if/when the icu devs remove the idna code instead of deactivating it in a header file) cherry-picking/backporting those two commits might be worth a shot. |
Are there any accumulated list of scripts for enabling php extensions in docker php images (jessie,stretch and alpine)? that we can use to easilies make our docker image work, (and not need to be a linux machine nerd?) |
@joelharkes There isn't any list as such since it would never be complete. @tianon wrote this blog post and explained how he figures out deps in #75 (comment). |
See also https://github.com/mlocati/docker-php-extension-installer for an attempt to create/maintain such a list (no Alpine support currently). |
Hi, I am facing ERROR: intl is required though i have tried by commenting the extension=php_intl.dll extension file in php.ini file. I can see php_intl.dll file in ext folder of php. Please help me to solve the issue. Thank You:) |
I'm not sure this is a right place for a help request. |
Thanks, I confirm this is working now! |
@Gasgeber FYI, PHP 5 is end of life (https://secure.php.net/supported-versions.php). |
Not only that, PHP7 is significantly faster. Yet, there's still no official php docker that ships with all dependencies, unless you make your own... so too bad if you're on a bad connection and have a slow cpu... |
thanks |
Hi Guys,
I have been trying to enable the intl extension and I have been running into troubles as it keeps failing.
I get:
I fixed this by running:
apt-get install libicu-dev
Rerunning the docker-php-ext-install intl then fails again with the following:
Is this a bug? The container doesn't appear to have the C++ compiler installed.
To fix i used:
apt-get install g++
Now the extension installs as expected.
I am using php:5.6-apache for reference.
Hope this helps.
Thanks,
Rob
The text was updated successfully, but these errors were encountered: