---
title: "Constants"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:globals-constants@11.5"
source: "ApiOverview/GlobalValues/Constants/Index.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v11 has reached end-of-life as of October 31th 2024 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# Constants {#globals-constants}

Constants in TYPO3 define paths and database information. These values
are global and cannot be changed.
Constants are defined at various points during the [bootstrap sequence](https://docs.typo3.org/permalink/t3coreapi:bootstrapping@11.5).

To make the information below a bit more compact, namespaces were left out. Here
are the fully qualified class names referred to below:

Check `\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::defineBaseConstants()`
method for more constants.

****Table of contents****

-   [Paths](https://docs.typo3.org/permalink/t3coreapi:paths@11.5)
-   [Security-related constant](https://docs.typo3.org/permalink/t3coreapi:security-related-constant@11.5)
-   [File types](https://docs.typo3.org/permalink/t3coreapi:file-types@11.5)
-   [HTTP status codes](https://docs.typo3.org/permalink/t3coreapi:http-status-codes@11.5)

## Paths {#paths}

### TYPO3_mainDir {#typo3-maindir}

This is the directory of the backend administration for the sites of
this TYPO3 installation. Hardcoded to `typo3/`. Must be a subdirectory
to the website.

-   **Defined in:**

    `SystemEnvironmentBuilder::defineBaseConstants()`

-   **Available in Frontend:**

    Yes

## Security-related constant {#security-related-constant}

### FILE_DENY_PATTERN_DEFAULT {#file-deny-pattern-default}

Default value of [$GLOBALS\['TYPO3_CONF_VARS'\]\['BE'\]\['fileDenyPattern'\]](https://docs.typo3.org/permalink/t3coreapi:typo3confvars-be-filedenypattern@11.5).

-   **Defined in:**

    `\TYPO3\CMS\Core\Resource\Security\FileNameValidator::FILE_DENY_PATTERN_DEFAULT`

-   **Example:**

    `\\.(php[3-8]?|phpsh|phtml|pht|phar|shtml|cgi)(\\..*)?$|\\.pl$|^\\.htaccess$`

-   **Available in frontend:**

    Yes

### TYPO3 {#globals-constants-typo3}

TYPO3 still has some extension PHP script files executed in global context
without class or callable encapsulation, namely `ext_localconf.php`,
`ext_tables.php` and files within `Configuration/TCA/Overrides/`.
When those files are located within the public document root of an instance and
called via HTTP directly, they may error out and render error messages. This can
be a security risk. To prevent this, those files **must** have a security gate
as first line:

```php
<?php

defined('TYPO3') or die();

// ... your code
```

It is defined to `true` in early TYPO3 bootstrap.

> [!NOTE]
> **See also**
>
> -   [ext_localconf.php](https://docs.typo3.org/permalink/t3coreapi:ext-localconf-php@11.5)
> -   [ext_tables.php](https://docs.typo3.org/permalink/t3coreapi:ext-tables-php@11.5)
> -   [Configuration/TCA/Overrides/](https://docs.typo3.org/permalink/t3coreapi:extension-configuration-tca-overrides@11.5)

## File types {#file-types}

Different types of file constants are defined in `\TYPO3\CMS\Core\Resource\AbstractFile`.
These constants are available for different groups of files as documented in
[https://www.iana.org/assignments/media-types/media-types.xhtml](https://www.iana.org/assignments/media-types/media-types.xhtml)

These file types are assigned to all [FAL](https://docs.typo3.org/permalink/t3coreapi:fal@11.5) resources. They can, for
example, be used in [Fluid](https://docs.typo3.org/permalink/t3coreapi:fluid@11.5) to decide how to render different types
of files.

| Constant | Value | Description |
| --- | --- | --- |
| `AbstractFile::FILETYPE_UNKNOWN` | 0 | Unknown |
| `AbstractFile::FILETYPE_TEXT` | 1 | Any kind of text |
| `AbstractFile::FILETYPE_IMAGE` | 2 | Any kind of image |
| `AbstractFile::FILETYPE_AUDIO` | 3 | Any kind of audio |
| `AbstractFile::FILETYPE_VIDEO` | 4 | Any kind of video |
| `AbstractFile::FILETYPE_APPLICATION` | 5 | Any kind of application |

## HTTP status codes {#http-status-codes}

The different status codes available are defined in
[EXT:core/Classes/Utility/HttpUtility.php (GitHub)](https://github.com/typo3/typo3/blob/11.5/typo3/sysext/core/Classes/Utility/HttpUtility.php).
These constants are defined as documented in
[https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
