Skip to content

Commit 8f36688

Browse files
authored
Document required quoting of booleans in php.ini (#5849)
1 parent dbdcefb commit 8f36688

File tree

1 file changed

+18
-0
lines changed
  • content/en/docs/languages/php

1 file changed

+18
-0
lines changed

content/en/docs/languages/php/sdk.md

+18
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ $meter = OpenTelemetry\API\Globals::meterProvider()->getMeter('name', 'version',
9898

9999
SDK autoloading happens as part of the composer autoloader.
100100

101+
### Configuration from php.ini
102+
103+
When providing configuration through `php.ini`, be sure to protect boolean
104+
values by double-quoting them, eg `"true"`, `"false"` so that PHP doesn't
105+
convert them to numbers.
106+
107+
`php.ini`:
108+
101109
### Excluded URLs
102110

103111
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:
134142

135143
Configurations can be provided as environment variables, or via `php.ini` (or a
136144
file included by `php.ini`)
145+
146+
{{% alert title="Boolean values in php.ini" %}} Boolean values in `php.ini`
147+
should be protected by double-quoting them, for example `"true"` or `"false"`,
148+
so that PHP doesn't convert them to numbers {{% /alert %}}
149+
150+
```ini
151+
OTEL_PHP_AUTOLOAD_ENABLED="true"
152+
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
153+
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
154+
```

0 commit comments

Comments
 (0)