As said in the OpenTelemetry PHP documentation, fibers support can be enabled with OTEL_PHP_FIBERS_ENABLED.
Using non-CLI SAPIs (e.g. fpm, fastcgi) may require to preload some bindings like:
ffi.preload=vendor/open-telemetry/context/fiber/zend_observer_fiber.h
opcache.preload=vendor/autoload.php
But when building the composer package from PHP built with buildPhpFromComposer (using loophp/nix-shell flake), the underlying derivation composer-local-repo-plugin fails as it is unable to start FFI module because it could not find the file mentioned in the option ffi.preload.
nix log /nix/store/0jp32vgnhlr0ks6ky2z4sylmqrj0dwpw-composer-local-repo-plugin-1.0.3.drv:
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/l5a037w0nj3iyfm8xhxh48vc6pa4m90l-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Warning: FFI: failed pre-loading 'vendor/open-telemetry/opentelemetry/src/Context/fiber/zend_observer_fiber.h', file doesn't exist in Unknown >
Fatal error: Unable to start FFI module in Unknown on line 0
The PHP derivation built from buildPhpFromComposer has the option but it does not contain the file from ffi.preload.
As said in the OpenTelemetry PHP documentation, fibers support can be enabled with
OTEL_PHP_FIBERS_ENABLED.Using non-
CLISAPIs (e.g. fpm, fastcgi) may require to preload some bindings like:But when building the
composerpackage from PHP built withbuildPhpFromComposer(using loophp/nix-shell flake), the underlying derivationcomposer-local-repo-pluginfails as it is unable to start FFI module because it could not find the file mentioned in the optionffi.preload.nix log /nix/store/0jp32vgnhlr0ks6ky2z4sylmqrj0dwpw-composer-local-repo-plugin-1.0.3.drv:The PHP derivation built from
buildPhpFromComposerhas the option but it does not contain the file fromffi.preload.