Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use PHP ini option ffi.preload #1

Open
gaelreyrol opened this issue Nov 4, 2023 · 0 comments
Open

Unable to use PHP ini option ffi.preload #1

gaelreyrol opened this issue Nov 4, 2023 · 0 comments
Assignees

Comments

@gaelreyrol
Copy link
Collaborator

gaelreyrol commented Nov 4, 2023

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.

@gaelreyrol gaelreyrol self-assigned this Nov 4, 2023
@gaelreyrol gaelreyrol changed the title Unable to set PHP ini option ffi.preload while build PHP from Composer Unable to use PHP ini option ffi.preload Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant