> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AppSignal for PHP config load order

You can configure AppSignal for PHP through the `config/appsignal.php` config file, or with environment variables.

The configuration is loaded in a three-step process, starting with the package defaults and ending with reading the config file. The configuration options can be mixed without losing configuration from a different option.

## Load order

* 1. [Package defaults - `default`](#1-package-defaults)
* 2. [Environment variables - `env`](#2-environment-variables)
* 3. [Config file - `file`](#3-config-file)

## 1. Package defaults

The package starts with loading its default configuration, setting paths and enabling certain features. The package defaults can be found in the [configuration options documentation](/php/configuration/options).

## 2. Environment variables

AppSignal looks for configuration in environment variables. When found, these override the package defaults.

You can pass environment variables to one-off PHP scripts:

```bash Shell theme={null}
export APPSIGNAL_APP_NAME="my custom app name"
```

or for your PHP application this is typically done via a `.env` file:

```bash title=".env" theme={null}
APPSIGNAL_ACTIVE=true
APPSIGNAL_APP_NAME="my custom app name"
APPSIGNAL_PUSH_API_KEY=local
```

Supported environment variables are documented in the `env_key` definition for each [configuration option](/php/configuration/options).

## 3. Config file

AppSignal looks for configuration in the `config/appsignal.php` file. Options in this file override all configuration options set in previous steps.

```php title="config/appsignal.php" theme={null}
return [
	'app_name' => 'my custom app name',
	// ... other options
];
```

Supported keys are documented in the `config_key` definition for each [configuration option](/php/configuration/options).
