php / php/php-src

Conditional Runtime PHP Extension loading

Open
#19,812 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I would like to build a docker container with various PHP extensions and be able to toggle them off with environment variables. (OpenTelemetry / XDebug / Tideways / Blackfire does not like each other). Of course I can build various tags, but it's an hassle of CI managment.

The solution who most people are doing is to use the docker entrypoint to move files to disable loading of extensions. This does not work when the container is read-only. Therefore I would suggest to have some kind of environment variable to disable / enable extension on the fly.

Several ideas I had so far:

in php.ini

{if hasEnv("FOO")}
extension=foo.so
{/if}

so we can toggle even php.ini settings

or a simple

PHP_EXTENSIONS_DISABLE=opentelemetry

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name implementation files, tests, or entry points. Start by tracing PHP's extension-loading and configuration handling, then determine how environment-based enabling or disabling should work, including the proposed php.ini conditionals. Done means an agreed design is implemented and covered for read-only containers and runtime extension toggling.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.