Fix and improve adding-extensions docs

Created on 19 December 2024, 5 months ago

Problem/Motivation

Adding PHP extensions is under-documented and seems to have bugs.

Proposed resolution

List and discuss here, once stabilized roll MR(s).

- Link the docs in the template for convenience
- The ".phpunit-base:" in current docs is wrong in general case and needs explanation.
- There should be an example of ext-* installation, see
- https://stackoverflow.com/a/64445115
- https://github.com/docker-library/docs/tree/master/php#how-to-install-mo...

📌 Task
Status

Active

Component

Documentation

Created by

🇩🇪Germany geek-merlin Freiburg, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @geek-merlin
  • 🇩🇪Germany geek-merlin Freiburg, Germany
  • 🇪🇸Spain fjgarlin

    Not sure what you mean with The ".phpunit-base" in current docs is wrong in general case.

    There are two examples provided in the docs, which come from actual modules:

    You can use apt-get to install new packages. For example, imagemagick needs extra packages:

    .phpunit-base:
      before_script:
        - apt-get update
        - apt-get install -y --no-install-recommends imagemagick
    

    Or Redis needs the redis PHP extension:

    .phpunit-base:
      before_script:
        - apt-get update
        - apt-get install -y --no-install-recommends $PHPIZE_DEPS
        - pecl install redis && docker-php-ext-enable redis
    

    So it shows how to add a package and an extension, viewing the basic apt-get, pecl and docker-php-ext-enable usage.

    I'm not sure that we can cover all cases, but if you add an example here we can definitely add it to the docs.

  • 🇩🇪Germany geek-merlin Freiburg, Germany

    Yep, redis needs the extension *in the phpunit job*, but ymmv...
    My prob was different and now sessionless may serve as another example to link to.
    But i don't want to spread more half-baked knowledge, please let people who know better write that doc.

  • 🇪🇸Spain fjgarlin

    Did the code you added here work? https://git.drupalcode.org/project/sessionless/-/blob/3.x/.gitlab-ci.yml...

    That, together with the other examples, would help us improve this section of the documentation, but I want to make sure that it's working before assuming anything.

Production build 0.71.5 2024