I am trying to install/enable the PHP http extension on my PHP alpine image.
My composer.json
file for my application contains "ext-http": "*"
, hence my goal.
My Dockerfile (relevant portions) is as follows:
# PHP-FPM Base Image
FROM php:7.2.26-fpm-alpine
# Install PHP extensions
RUN apk add --update --virtual .build-deps autoconf g++ make zlib-dev curl-dev \
&& pecl install raphf propro \
&& docker-php-ext-enable raphf propro \
&& pecl install pecl_http \
&& echo -e "extension=raphf.so\nextension=propro.so\nextension=http.so" > /usr/local/etc/php/conf.d/docker-php-ext-http.ini \
&& rm -rf /usr/local/etc/php/conf.d/docker-php-ext-raphf.ini \
&& rm -rf /usr/local/etc/php/conf.d/docker-php-ext-propro.ini \
&& apk del .build-deps \
&& rm -rf /tmp/*
However when running composer update
, I get the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'http.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/http.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20170718/http.so: uidna_IDNToASCII: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/http.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20170718/http.so.so: No such file or directory)) in Unknown on line 0
After which, the composer update
command fails:
The requested PHP extension ext-http * is missing from your system. Install or enable PHP's http extension.
The http.so.so
part of the warning gives me pause, making me think the file is being looked for in an incorrect location.
My reference is the following Dockerfile: https://hub.docker.com/r/realpaul/docker-php/dockerfile
Can someone please help me debug this issue? Thank you!