-
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
Proper iconv #240
Comments
Technically the musl behavior is correct according POSIX as explained in related issue: akrennmair/newsbeuter#364 (comment) |
This workaround works fine in alpine 3.3 but if I try to compile php on 3.5 I get this error. Same docker file but changed the version.
Any magic I'm missing? |
I came across this gist which may help! (adjust for your version of PHP) https://gist.github.com/guillemcanal/be3db96d3caa315b4e2b8259cab7d07e |
A little bit cleaner hack:
Test case:
If you don't get this notice it means it works as expected. |
@alexanderilyin should that code fix this issue? I can't make it work. This is my dockerfile
|
@delmicio iconv works fully (transliteration included) with this hack, even though it registers as "unknown" in the phpinfo() output. |
@delmicio here is a "test case":
If you don't get this notice it means it works as expected. |
@alexanderilyin yes it's working with your code, although the version keeps unknown. A mystery. |
@alexanderilyin solution works great. Tested also with repository |
Confirmed that @alexanderilyin solution works. I altered the URL to be based off a CDN link instead: 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 |
This appears to be a quirk of PHP when used with musl, and as noted by ncopa above, is POSIX compliant. Given that and that this thread documents at least one reasonable workaround for folks for whom the default behavior is unacceptable, I'm going to close. Additionally, I imagine using the Debian variants of the image would likely also work. Thanks! ❤️ |
In my case it was fixed with by installing PS PSS |
Just bumped into this on php7.4-fpm, running |
PHP (8) has to be built with |
In case someone lands here, facing the RUN apk --no-cache add php7-mbstring php7-iconv Original solution here: #240 (comment) Edit: @rufinus, I edited my comment, as I believe it will still be helpful for people landing on this thread. |
thats no solution - u just use the module from alpine. this thread is about compiling modules and using official php container. |
If you're going to |
This comment has been minimized.
This comment has been minimized.
FYI, #1264 implements upstream's recommendation from https://www.php.net/manual/en/intro.iconv.php to use GNU libiconv instead. |
iconv
is not working as expected on a vanilla php image. The solution is to install GNUs libiconv:https://ftp.gnu.org/pub/gnu/libiconv/
... and linking this with
php
duringconfigure
process, or give the GNU library precedence:In any case, this script should not produce errors (as it does on current php images):
Current work-around:
The text was updated successfully, but these errors were encountered: