Laradock: Help : Adding bz2 extension

Created on 10 Sep 2016  路  3Comments  路  Source: laradock/laradock

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

Need Help

Most helpful comment

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!

All 3 comments

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConstantinChirila picture ConstantinChirila  路  3Comments

SamAriafar picture SamAriafar  路  3Comments

fuzzyjared picture fuzzyjared  路  3Comments

zongmi picture zongmi  路  3Comments

danielsdeboer picture danielsdeboer  路  3Comments