Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

ICONV_IMPL can be unknown on Alpine linux #98

Closed
wants to merge 10 commits into from
Closed

ICONV_IMPL can be unknown on Alpine linux #98

wants to merge 10 commits into from

Conversation

misaon
Copy link

@misaon misaon commented Feb 7, 2019

Alpine Linux is a very common Linux distribution used in Docker images. But it has one problem. The official repository is missing the libiconv package needed to compile the ICONV PHP extensions.

There is one very well known thread that addresses this bug docker-library/php#240. This is how Alpine Linux makes a functional extension of ICONV. One solution exists, LD_PRELOAD is used for this environment.

RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

You can install the gnu-libiconv package from the test repository to Alpine, but PHP will not recognize it. If I use the iconv function and I have this package installed in Alpine, everything works OK but phpinfo () says enabled => unknown.
That's why I removed this rule from the checker. I think that a sufficient rule to verify the functionality of the ICONV extension is already applied: @iconv ('UTF-16', 'UTF-8 // IGNORE', iconv ('UTF-8', 'UTF-16 // IGNORE' test ')) ===' test '.

dg and others added 10 commits October 5, 2018 19:11
Disable rewrite for more typical file types in case the file doesn't exist.
Alpine Linux is a very common Linux distribution used in Docker images. But it has one problem. The official repository is missing the libiconv package needed to compile the ICONV PHP extensions.

There is one very well known thread that addresses this bug docker-library/php#240. This is how Alpine Linux makes a functional extension of ICONV. One solution exists, LD_PRELOAD is used for this environment. 

RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

You can install the gnu-libiconv package from the test repository to Alpine, but PHP will not recognize it. If I use the iconv function and I have this package installed in Alpine, everything works OK but phpinfo () says enabled => unknown. 
That's why I removed this rule from the checker. I think that a sufficient rule to verify the functionality of the ICONV extension is already applied: @iconv ('UTF-16', 'UTF-8 // IGNORE', iconv ('UTF-8', 'UTF-16 // IGNORE' test ')) ===' test '.
@dg
Copy link
Member

dg commented Feb 7, 2019

Related nette/utils#109

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants