# HeadersAlreadySentException

> HeadersAlreadySentException represents an exception caused by any headers that were already sent before web response was sent.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [web](/docs/api/yii/web/index.md) › HeadersAlreadySentException

| class | `yii\web\HeadersAlreadySentException` |
| --- | --- |
| Extends | [`yii\base\Exception`](/docs/api/yii/base/exception/index.md) » [`Exception`](https://www.php.net/manual/en/class.exception.php) |
| Since | 2.0.14 |
| Source | [`framework/web/HeadersAlreadySentException.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/web/HeadersAlreadySentException.php#L20) |

HeadersAlreadySentException represents an exception caused by
any headers that were already sent before web response was sent.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) |  | `HeadersAlreadySentException` |
| <span id="method-getName"></span>[`getName()`](/docs/api/yii/base/exception/index.md#method-getName) |  | [`yii\base\Exception`](/docs/api/yii/base/exception/index.md) |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(mixed $file, mixed $line)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$file` | `mixed` |  |
| `$line` | `mixed` |  |