thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
785 stars 138 forks source link

Additional PHP extensions installation #306

Closed bmmarko closed 2 years ago

bmmarko commented 2 years ago

Hi all

First of all, great work thecodingmachine you surely save developers lives with this bundle of PHP images!!!

I'm wondering how additional extensions could be configured? For example, I was trying to add German PHP extension but without success. I can install OS level dependencies e.g. German client and server, but not PHP extension.

Couldn't find documentation for this, and in the existing issues there is only one that tackles this for V3.

Thanks for any help!

evs-xsarus commented 2 years ago

How to do this using GitLab CI/CD ?

mistraloz commented 2 years ago

Hello Marko. Thx for your support.

Did you speak about Gearman pecl extention ?

You can make a PR in this repository with a new file like this one https://github.com/thecodingmachine/docker-images-php/blob/v4/extensions/core/rdkafka/install.sh ans symbolic link like others for each version here : https://github.com/thecodingmachine/docker-images-php/tree/v4/extensions/8.1

Then, use make command. make test-8.1 (who will call ./build-and-test.sh). To ensure quality, please add a test case in ./build-and-test.sh for your extension.

Maybe it's all for that.

ps: or you can build a custom image from ours but i think it's better to make a PR on our repository for that.

bmmarko commented 2 years ago

Hello @mistraloz Thank you very much for your help! Works great, tested locally and I will create PR.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not had recent activity. Please, reopen if you need.

dereuromark commented 1 year ago

Is there an easier way to just add intl extension?

  services:
    - mysql:5.7
  image: thecodingmachine/php:8.1-v4-fpm-node14

But I dont find an easy way to add the one missing extension "intl" here.

dereuromark commented 1 year ago

The weird part:

sudo apt-get install php8.1-intl

gives

php8.1-intl is already the newest version (8.1.16+repack-1+ubuntu20.04.1+deb.sury.org+1).

But it isnt there then:

cakephp/cakephp 4.4.11 requires ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.

Also tried

  before_script:
  - sudo echo "extension=intl" >> /etc/php/8.1/cli/php.ini

but /usr/bin/bash: line 142: /etc/php/8.1/cli/php.ini: Permission denied

//EDIT OK

variables:
  PHP_EXTENSIONS: intl pdo_sqlite

works, but I still think some of those should be enabled also by default.