WordPress hosting
Environment variables
Overview

Environment variables

Configure WordPress instance using environment variables

Environment 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.

Variables management page

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:

Summary of protected environment variables
CategoryDescriptionVariable name
Database configuration

Variables related to the configuration of the WordPress database.

DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, DB_CHARSET, DB_COLLATE

Memory and performance

Variables related to memory and performance management in WordPress.

WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, EMPTY_TRASH_DAYS, FORCE_SSL_ADMIN

Debugging and developmentVariables used during debugging and development in WordPress.

WP_DEBUG_DISPLAY, WP_DEBUG, SCRIPT_DEBUG, DISALLOW_FILE_MODS, DISALLOW_FILE_EDIT

Authentication and securityVariables related to authentication and security in WordPress.

AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT, WP_CACHE_KEY_SALT

FTP access configurationVariables related to FTP access configuration in WordPress.

FS_METHOD, FTP_BASE, FTP_CONTENT_DIR, FTP_PLUGIN_DIR, FTP_PUBKEY, FTP_PRIKEY, FTP_USER, FTP_PASS, FTP_HOST, FTP_SSL

Redis configurationVariables related to Redis configuration in WordPress.

WP_REDIS_CLIENT, WP_REDIS_READ_TIMEOUT, WP_REDIS_TIMEOUT, WP_REDIS_PORT, WP_REDIS_DATABASE, WP_REDIS_HOST, WP_REDIS_IGBINARY, WP_REDIS_PREFIX,

Other configurationsMiscellaneous configuration variables in WordPress.

WP_CONTENT_DIR, WP_PLUGIN_DIR, PLUGINDIR, WP_DISABLE_FATAL_ERROR_HANDLER, WP_HTTP_BLOCK_EXTERNAL, APP_VERSION, ABSPATH, FORCE_SSL_ADMIN, WPINC, WP_ALLOW_REPAIR

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.

Summary of default environment variables
Variable nameDescription
WP_ENVIRONMENT_TYPE

Environment type related to WordPress documentation. It is set to staging for non-production environments and production for environments with an attached domain.

WP_REDIS_...Enforced Redis configuration variables.
WP_AUTO_UPDATE_COREEnforce 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 uploads directory can be modified.

STATIK_API_ENDPOINTSiteBox API endpoint which is used by instance to communicate.
STATIK_API_TOKEN

Environment API authorization token, which can perform only approved actions.

STATIK_COMPANY_IDEnvironment parent company identifier.
STATIK_PROJECT_IDEnvironment parent project identifier.
STATIK_BACKEND_IDEnvironment identifier.
APP_VERSIONCurrent deployment identifier, can be used to cache busting.