I'm using Laradock on Windows 7. I need to install bz2 extension, so I edited the php-fpm Dockerfile-70 as below.
Added below code -
ARG INSTALL_BZ2=true
RUN if [ ${INSTALL_BZ2} = true ]; then \
# Install the bz2 extension
pecl install bz2 && \
docker-php-ext-enable bz2 \
;fi
Then when I run docker-compose build php-fpm I get few following error. I did google search and tried suggestions, nothing so far worked.
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
ERROR: `phpize' failed
Please advice on this. Thanks
I think you should actually be doing the following:
RUN apt-get install -y libbz2-dev && \
docker-php-ext-install bz2
If you look at the bz2 pecl page, the last update was in 2003 and it's now deprecated. If you look at the PHP docs, it says to compile it with PHP to enable it. The docker php image uses the docker-php-ext-install command to help with this. It needs the libbz2-dev dependency first though, as I found from here: https://github.com/docker-library/php/issues/47
I haven't tried it, but give it a shot!
@francislavoie Thank you very much it worked.
For workspace container :
apt-get install -y libbz2-dev && apt-get install -y php7.1-bz2
Most helpful comment
I think you should actually be doing the following:
If you look at the bz2 pecl page, the last update was in 2003 and it's now deprecated. If you look at the PHP docs, it says to compile it with PHP to enable it. The docker php image uses the
docker-php-ext-installcommand to help with this. It needs thelibbz2-devdependency first though, as I found from here: https://github.com/docker-library/php/issues/47I haven't tried it, but give it a shot!