From 8f36688b25d3ab514004508c9c2ffb604e12478a Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Wed, 25 Dec 2024 16:38:57 +1100 Subject: [PATCH] Document required quoting of booleans in php.ini (#5849) --- content/en/docs/languages/php/sdk.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/content/en/docs/languages/php/sdk.md b/content/en/docs/languages/php/sdk.md index fcc89f0dca92..c384558c34bf 100644 --- a/content/en/docs/languages/php/sdk.md +++ b/content/en/docs/languages/php/sdk.md @@ -98,6 +98,14 @@ $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 +142,13 @@ 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 +```