Skip to content

Commit

Permalink
Document required quoting of booleans in php.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Dec 24, 2024
1 parent a8973d1 commit 22cf6f2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 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,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.
Expand Down Expand Up @@ -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
```

0 comments on commit 22cf6f2

Please sign in to comment.