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

Document required quoting of booleans in php.ini #5849

Merged
merged 2 commits into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions content/en/docs/languages/php/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
```
Loading