Your web/index.php file can define certain PHP constants, which Craft’s bootstrap script will check for while loading and configuring Craft.
The path to the base directory that Craft will look for config/, templates/, and other directories within by default. (It is assumed to be the parent of the vendor/ folder by default.)
// Tell Craft to look for config/, templates/, etc., two levels up from here
define('CRAFT_BASE_PATH', dirname(__DIR__, 2));The path to the composer.json file. (It is assumed to live within the base directory by default.)
define('CRAFT_COMPOSER_PATH', 'path/to/composer.json');The path to the config/ folder. (It is assumed to live within the base directory by default.)
The path to the migrations/ folder used to store content migrations. (It is assumed to live within the base directory by default.)
The environment name that multi-environment configs can reference when defining their environment-specific config arrays. ($_SERVER['SERVER_NAME'] will be used by default.)
// Set the environment from the ENVIRONMENT env var, or default to 'production'
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');Your Craft license key, if for some reason that must be defined by PHP rather than a license key file. (Don’t set this until you have a valid license key.)
The path that Craft should store its license key file, including its filename. (It will be stored as license.key within your config/ folder by default.)
Can be set to false to prevent Craft from setting PHP’s log_errors setting, leaving it up to whatever’s set in php.ini.
// Don't send PHP error logs to storage/logs/phperrors.log
define('CRAFT_LOG_PHP_ERRORS', false);The Site handle or ID that Craft should be serving from this index.php file. (Only set this if you have a good reason to. Craft will automatically serve the correct site by inspecting the requested URL, unless this is set.)
// Show the German site
define('CRAFT_SITE', 'de');The path to the storage/ folder. (It is assumed to live within the base directory by default.)
::: tip Make sure you set this to a valid folder path, otherwise it will be ignored. :::
The path to the templates/ folder. (It is assumed to live within the base directory by default.)
The path to the translations/ folder. (It is assumed to live within the base directory by default.)
The path to the vendor/ folder. (It is assumed to live 4 directories up from the bootstrap script by default.)