Skip to content

Commit

Permalink
Document required quoting of booleans in php.ini (#5849)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc authored Dec 25, 2024
1 parent dbdcefb commit 8f36688
Showing 1 changed file with 18 additions and 0 deletions.
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
```

0 comments on commit 8f36688

Please sign in to comment.