eugeneware / docker-php-5.3-apache

php 5.3 with apache
20 stars 30 forks source link

Can't install bcmath through docker-php-ext-install #2

Open Mo0812 opened 5 years ago

Mo0812 commented 5 years ago

When I try to install the module bcmath through docker-php-ext-install I get the following error:

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
docker-php-ext-enable bcmath.so
/usr/local/bin/docker-php-ext-enable: line 61: /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini: No such file or directory

Do you have any advice how to fix it?

raphaelsoul commented 5 years ago

same issue when installing gd library

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files:          /usr/local/include/php/
docker-php-ext-enable gd.so 
/usr/local/bin/docker-php-ext-enable: line 61: /usr/local/etc/php/conf.d/docker-php-ext-gd.ini: No such file or directory
ERROR: Service 'app' failed to build: The command '/bin/sh -c docker-php-ext-install gd' returned a non-zero code: 1
hareku commented 5 years ago

PHP ini file path is broken in docker-php-ext-enable. https://github.com/eugeneware/docker-php-5.3-apache/blob/master/docker-php-ext-enable#L59

I fixed it with $PHP_INI_DIR env.

ini="$PHP_INI_DIR/conf.d/docker-php-ext-$ext.ini"

You can copy a fixed script.

FROM eugeneware/php-5.3
COPY ./fixed-docker-php-ext-enable /usr/local/bin/docker-php-ext-enable
RUN docker-php-ext-install curl
jquinter commented 5 years ago

PHP ini file path is broken in docker-php-ext-enable. https://github.com/eugeneware/docker-php-5.3-apache/blob/master/docker-php-ext-enable#L59

I fixed it with $PHP_INI_DIR env.

ini="$PHP_INI_DIR/conf.d/docker-php-ext-$ext.ini"

You can copy a fixed script.

FROM eugeneware/php-5.3
COPY ./fixed-docker-php-ext-enable /usr/local/bin/docker-php-ext-enable
RUN docker-php-ext-install curl

you should post a PR with this. I also experimented this problem (installing another extension), and with your fix I solved it.