Environment variables
Configure WordPress instance using environment variablesEnvironment variables, are configuration data stored at the operating system or runtime environment level of an application. These are textual values that assist in customizing an application's behavior to specific environmental conditions.
"Variables" can be edited from the SiteBox Dashboard, where you can add and remove environment variables. You can use them for purposes such as:
- Configuring application – they allow you to store configuration settings, such as API keys, database passwords, or external server addresses. This prevents sensitive information from being hard-coded in the application source code, enhancing security.
- Separating production environments – environment variables enable you to adapt applications to different environments, such as development, testing, and production. You can easily change variables depending on the environment in which the application is running.
- Protecting sensitive data – they assist in safeguarding sensitive information since values like passwords are not openly stored within the application code, enhancing security and protecting sensitive data.
All environment variables are stored in the wp-config.php
file and can be accessed using
standard PHP methods for reading constants.
It's important to remember that each change to environment variables needs to be deployed in the environment.
Protected variables
To ensure WordPress functions correctly, certain environment variables cannot be set from the SiteBox Dashboard. These variables are essential for the proper functioning of the instance and should not be overwritten. Here is a list of protected environment variables:
Category | Description | Variable name |
---|---|---|
Database configuration | Variables related to the configuration of the WordPress database. |
|
Memory and performance | Variables related to memory and performance management in WordPress. |
|
Debugging and development | Variables used during debugging and development in WordPress. |
|
Authentication and security | Variables related to authentication and security in WordPress. |
|
FTP access configuration | Variables related to FTP access configuration in WordPress. |
|
Redis configuration | Variables related to Redis configuration in WordPress. |
|
Other configurations | Miscellaneous configuration variables in WordPress. |
|
Additionally, all environmental variables starting with STATIK_
are reserved for internal use by our infrastructure
and should not be modified or overridden. These variables are used to configure and manage various aspects of the
SiteBox environment and should not be altered to ensure the proper functioning of our services.
Default variables
SiteBox adds several useful environmental variables to each environment that can be utilized for identifying your environment. You are free to make use of these variables in your application as needed. These variables can provide valuable information about the environment your application is running in, allowing for better configuration and adaptability to different deployment scenarios.
Variable name | Description |
---|---|
WP_ENVIRONMENT_TYPE | Environment type related to WordPress
documentation.
It is set to |
WP_REDIS_... | Enforced Redis configuration variables. |
WP_AUTO_UPDATE_CORE | Enforce WordPress updates to be disable. |
DISABLE_WP_CRON | Enforce WordPress CRON to be disable. Scheduler is handled by SiteBox. |
DISALLOW_FILE_MODS and DISALLOW_FILE_EDIT | Disallow possibility to edit any file on the server. Only |
STATIK_API_ENDPOINT | SiteBox API endpoint which is used by instance to communicate. |
STATIK_API_TOKEN | Environment API authorization token, which can perform only approved actions. |
STATIK_COMPANY_ID | Environment parent company identifier. |
STATIK_PROJECT_ID | Environment parent project identifier. |
STATIK_BACKEND_ID | Environment identifier. |
APP_VERSION | Current deployment identifier, can be used to cache busting. |