lorisleiva / laravel-docker

🐳 Generic docker image for Laravel Applications
MIT License
934 stars 314 forks source link

[Question] How to add/enable other extensions like gmp #57

Closed ajcastro closed 4 years ago

ajcastro commented 4 years ago

I have a laravel application and I use "laravel-notification-channels/webpush": "^5.0", and this requires gmp extension. How can I add/enable such extension? Thanks a lot!

ajcastro commented 4 years ago

I think I found it: https://github.com/codecasts/php-alpine#dockerfile

ajcastro commented 4 years ago

Reopening this because I tried the following but didnt work:

before_script:
    - apk add php7.2-gmp
before_script:
    - apk add php-gmp
lorisleiva commented 4 years ago

I don't think it's enough to install the extension, you should also enable it via the docker helper commands such as docker-php-ext-configure and docker-php-ext-install.

Have a look at the Dockerfiles of this repo to get some inspirations 🙂

Synchro commented 1 year ago

I managed to make this work by adding a line to my composer installation stage's script section:

install-php-extensions gmp