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

[PHP 7.2] iconv extension problem #29

Closed
misaon opened this issue Mar 13, 2018 · 7 comments
Closed

[PHP 7.2] iconv extension problem #29

misaon opened this issue Mar 13, 2018 · 7 comments

Comments

@misaon
Copy link

misaon commented Mar 13, 2018

Hi i have problem with install ICONV php extension on alpine 3.7.

My Dockerfile:

# Trust this project public key to trust the PHP packages.
ADD https://php.codecasts.rocks/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub

# Environment variables
ENV PHP_PACKAGES="php7-fpm@php php7-mbstring@php php7-mcrypt@php php7-xmlrpc@php php7-sysvsem@php php7-sysvshm@php php7-intl@php php7-session@php php7-opcache@php php7-iconv@php php7-json@php php7-curl@php php7-pdo_sqlite@php php7-mysqlnd@php php7-pdo_mysql@php php7-openssl@php php7-ctype@php php7-gd@php" \
    ESSENTIAL_PACKAGES="nginx supervisor sed py-pip ca-certificates" \
    UTILITY_PACKAGES="bash nano"

# Add the PHP repository and fix ICONV extension
RUN echo "@php https://php.codecasts.rocks/v3.7/php-7.2" >> /etc/apk/repositories

# Configure php/php-fpm
RUN apk --no-cache --progress add $PHP_PACKAGES

...

When i run phpinfo i see this message:

snimek obrazovky 2018-03-13 v 9 54 18

snimek obrazovky 2018-03-13 v 9 55 02

The same problem: docker-library/php#240

Any ideas? Thanks a lot!

@misaon
Copy link
Author

misaon commented Mar 13, 2018

Fixed with this "hack":

#####################################################################
######################## FIX iconv extension #######################$
#####################################################################
ENV BUILD_PACKAGES="wget build-base php7-dev autoconf re2c libtool"
RUN apk --no-cache --progress add $BUILD_PACKAGES \
# Install GNU libiconv
&& mkdir -p /opt \
&& cd /opt \
&& wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz \
&& tar xzf libiconv-1.15.tar.gz \
&& cd libiconv-1.15 \
&& sed -i 's/_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");/#if HAVE_RAW_DECL_GETS\n_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");\n#endif/g' srclib/stdio.in.h \
&& ./configure --prefix=/usr/local \
&& make \
&& make install \
# Install PHP iconv from source
&& cd /opt \
&& wget http://php.net/distributions/php-7.1.5.tar.gz \
&& tar xzf php-7.1.5.tar.gz \
&& cd php-7.1.5/ext/iconv \
&& phpize \
&& ./configure --with-iconv=/usr/local \
&& make \
&& make install \
&& mkdir -p /etc/php7/conf.d \
&& echo "extension=iconv.so" >> /etc/php7/conf.d/iconv.ini \
# Cleanup
&& apk del $BUILD_PACKAGES \
&& rm -rf /opt \
&& rm -rf /var/cache/apk/* \
&& rm -rf /usr/share/*
#####################################################################
#####################################################################
#####################################################################

@misaon misaon closed this as completed Mar 13, 2018
@hernandev
Copy link
Member

@misaon new builds were published today, please check if the problem persists.

@misaon
Copy link
Author

misaon commented Mar 15, 2018

@hernandev Thanks for reply but i rewrite my all my Docker image.
I cant check if problem persist.

@misaon
Copy link
Author

misaon commented Mar 16, 2018

Problem persist. I found fix in other repository https://github.com/richarvey/nginx-php-fpm/blob/master/Dockerfile#L15

@misaon misaon reopened this Mar 16, 2018
@hernandev
Copy link
Member

I'll check this, thanks for reporting.

@hernandev
Copy link
Member

screenshot from 2018-04-09 11-53-07

On the latest releases, I cannot reproduce this problem.

Also, images were updated to php-7.2.4 and php-7.1.16, maybe this alone fixes the issue.

Waiting on confirmation.

@hernandev
Copy link
Member

If the problem persists, please re-open the issue, or start a new one, and I'll check. Thank you all!

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

No branches or pull requests

2 participants