That's my dockerfile setup. When I use Laravel Dompdf the error will show "iconv(): Wrong charset, conversion from utf-8' to
us-ascii//TRANSLIT' is not allowed"
And I have been checked the PHP ini, the iconv has been enabled. In my docker file also added the iconv installation command. It still doesn't work. Any solutions for my docker setting?
FROM php:7.3.33-fpm-alpine
# Fix: iconv(): Wrong charset, conversion from UTF-8 to UTF-8//IGNORE is not allowed in Command line code on line 1
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# Install php extensions
RUN apk update \
&& apk add --no-cache libzip-dev libmcrypt libmcrypt-dev zlib-dev \
&& docker-php-ext-install exif zip bcmath mysqli pdo pdo_mysql ctype json
# Install GD extensions
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
docker-php-ext-install -j${NPROC} gd && \
apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN apk --no-cache update \
&& apk --no-cache add make bash g++ zlib-dev libpng-dev \
&& rm -fr /var/cache/apk/*
# Install npm for Laravel Mix
RUN apk add npm
RUN apk add nodejs-lts --update
RUN npm install -g npm
WORKDIR /application
EXPOSE 9000
# Start services
CMD ["php-fpm"]
1条答案
按热度按时间mbyulnm01#
这对我有用