ext-ds icon indicating copy to clipboard operation
ext-ds copied to clipboard

How to install in PHP8 Docker alpine:version image?

Open jonatansantana opened this issue 4 years ago • 8 comments

I tried to install using pecl, curl, pickle and some other suggested ways I found on the internet, but with no success. Is this extension really available for php8?

This work:

 RUN apk --no-cache add \
  php8 \
  php8-curl 

But...

 RUN apk --no-cache add \
  php8 \
  php8-ds  #or php8-pecl-ds

Not work.

I tried using this another way. No error occurs, I assume I have it installed, but I can't use the extension. I don't know if I need to do anything else. I would like some help with that.

&& mkdir -p /usr/bin/php/ext/ds && curl -fsSL https://pecl.php.net/get/ds | tar xvz -C "/usr/bin/php/ext/ds" --strip 1

jonatansantana avatar Aug 30 '21 13:08 jonatansantana

It works just fine using pecl.

FROM php:8.0-alpine

RUN apk add --no-cache ${PHPIZE_DEPS} && \
    pecl install ds && \
    docker-php-ext-enable ds

enumag avatar Aug 30 '21 15:08 enumag

Not work for FROM alpine:3.14. do you know how i can install using this image?

jonatansantana avatar Aug 30 '21 15:08 jonatansantana

Well you need to use base PHP image obviously. If you want Alpine 3.14 then it's FROM php:8.0-fpm-alpine3.14

enumag avatar Aug 30 '21 16:08 enumag

A feather. I would like to continue using the linux alpine image and install the necessary extensions for me. :/

jonatansantana avatar Aug 30 '21 17:08 jonatansantana

Well you still need to install manually from pecl because no official package exists for this extension... So pecl install ds and then add it to php.ini... You will likely need to apk install php8-dev first to use pecl this way.

enumag avatar Sep 15 '21 05:09 enumag

@jonatansantana did you get this working? Are you still trying to otherwise?

rtheunissen avatar Dec 13 '21 18:12 rtheunissen

@jonatansantana you might want to have a look at https://github.com/codecasts/php-alpine/

tobias-trozowski avatar Dec 14 '21 02:12 tobias-trozowski

I get the following output when I do pecl install ds in an alpine image.

Build process completed successfully

**Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20220829/ds.so'**
install ok: channel://pecl.php.net/ds-1.4.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=ds.so" to php.ini
...

I don't think ds.so is installed in correct place?!

dilawar avatar Oct 28 '23 04:10 dilawar

I think you'd still need to enable the extension, I'm not sure that pecl does that for you. This is otherwise a pecl issue and not a fault of this project, right?

rtheunissen avatar Oct 28 '23 22:10 rtheunissen