From 22cf6f230600142add1183e6ead73420d291f1f3 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Tue, 24 Dec 2024 02:34:06 +0000 Subject: [PATCH] Document required quoting of booleans in php.ini --- content/en/docs/languages/php/sdk.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/content/en/docs/languages/php/sdk.md b/content/en/docs/languages/php/sdk.md index fcc89f0dca92..cf99b9c68bf5 100644 --- a/content/en/docs/languages/php/sdk.md +++ b/content/en/docs/languages/php/sdk.md @@ -98,6 +98,15 @@ $meter = OpenTelemetry\API\Globals::meterProvider()->getMeter('name', 'version', SDK autoloading happens as part of the composer autoloader. +### Configuration from php.ini + +When providing configuration through `php.ini`, be sure to protect boolean values +by double-quoting them, eg `"true"`, `"false"` so that PHP doesn't convert them +to numbers. + +`php.ini`: + + ### Excluded URLs You can disable SDK autoloading if the request URL matches a regular expression. @@ -134,3 +143,14 @@ There are also a number of PHP-specific configurations: Configurations can be provided as environment variables, or via `php.ini` (or a file included by `php.ini`) + +{{% alert title="Boolean values in php.ini" %}} +Boolean values in `php.ini` should be protected by double-quoting them, for +example `"true"` or `"false"`, so that PHP doesn't convert them to numbers +{{% /alert %}} + +```ini +OTEL_PHP_AUTOLOAD_ENABLED="true" +OTEL_EXPORTER_OTLP_PROTOCOL=grpc +OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317 +```