Skip to content
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 iconv error #130

Open
codcodog opened this issue Sep 23, 2021 · 0 comments
Open

docker php iconv error #130

codcodog opened this issue Sep 23, 2021 · 0 comments

Comments

@codcodog
Copy link
Owner

docker php iconv error

场景

PHP docker 镜像,调用 iconv 函数报错:iconv(): Wrong charset, conversion from 'utf-8' to 'GBK' is not allowed

基础镜像是:

  • Alpine Linux 3.4.6
  • PHP 5.6.29

方案

Alpine Linux 自带的 libiconv 库版本太低导致.

在原有的 Dockerfile 新增两条指令:

RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.12/community/ gnu-libiconv=1.15-r2
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so

参考

Proper iconv

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

No branches or pull requests

1 participant