General Config Settings

Craft comes with a bunch of config settings that give you control over various aspects of its behavior.

All config settings should be placed within the array() in your craft/config/general.php file.

For example, if you want to enable Dev Mode and set Craft to use uncompressed Javascript files, your array would look like this:

return array(
    'devMode' => true,
    'useCompressedJs' => false,
);

Here is the definitive list of config settings you can add:


General #

appId #

AcceptsA string
Defaultnull
SinceCraft 2.2

The application ID, which is used for things like storing data caches and user sessions. If it’s not set, Craft will automatically generate one based on the server path. Setting it will help avoid the loss of data caches and user sessions when Craft is deployed using a deployment script that will store Craft in an inconsistent location, such as Capistrano. If you are using a load-balanced environment, make sure you use the same appId value for every server in the cluster.

'appId' => 'lannister',

cacheDuration #

AcceptsA string set to any valid PHP interval specification, or '0' if you wish to cache data indefinitely.
Default'P1D' (one day)
SinceCraft 1.0

The length of time Craft will store data caches. Also used by the {% cache %} template tag if no expiration time is specified as a parameter.

'cacheDuration' => 'P1W',

cacheMethod #

Accepts'apc', 'db', 'eaccelerator', 'file', 'memcache', 'redis', 'wincache', 'xcache', or 'zenddata'
Default'file'
SinceCraft 2.0

The method Craft will use to store data caches.

'cacheMethod' => 'memcache',

Note that this config setting has no effect on the {% cache %} template tag, which always stores its data in the database.

The DB, file, Memcache(d), and Redis cache methods each have their own additional config settings, which must be set in separate config files in the craft/config/ folder (dbcache.php, filecache.php, memcache.php and rediscache.php, respectively). You can find their default values in craft/app/etc/config/defaults/.

customAsciiCharMappings #

AcceptsAn array of key/value pairs mapping character codes to lower ASCII strings
Defaultarray() (an empty array)
SinceCraft 1.0

Any custom ASCII character mappings.

This array is merged into the default mapping array in StringHelper::getAsciiCharMap().

The keys should be the HTML decimal code equivalent of the character to search for and the value is the ASCII character used for swapping.

For example, the code for Æ is 198. See sites like http://character-code.com/ to look up additional codes.

'customAsciiCharMappings' => array(
    198 => 'AE',
    216 => 'O',
    197 => 'A',
),

defaultCookieDomain #

AcceptsA string
Default''
SinceCraft 2.2

The default domain name Craft will use when sending cookies to the browser. If it is left blank, Craft will leave it up to the browser to decide – which will be whatever the current request’s domain name is.

'defaultCookieDomain' => '.example.com',

defaultSearchTermOptions #

AcceptsAn array of key/value pairs
Defaultarray('attribute' => null, 'exact' => false, 'exclude' => false, 'subLeft' => false, 'subRight' => false)
SinceCraft 2.5

The default options Craft will apply to all search terms when searching for elements.

The array can contain the following keys;

  • attribute (string) – The element attribute the search term should apply to (e.g. 'title'). (Overridden if the search term in the actual query begins with someAttribute:.)
  • exact (boolean) – Whether the search term should be an exact match to the attribute’s value. (Only applicable when attribute is set, or the search term in the actual query begins with someAttribute:.)
  • exclude (boolean) – Whether the search results should exclude results where the search term is a match.
  • subLeft (boolean) – Whether to accept partial matches on keywords that have additional characters before the search term.
  • subRight (boolean) – Whether to accept partial matches on keywords that have additional characters after the search term.
'defaultSearchTermOptions' => array(
    'subLeft' => true,
    'subRight' => true,
),

devMode #

Acceptstrue or false
Defaultfalse
SinceCraft 1.0

Determines whether the system is in Dev Mode or not. (See What Dev Mode Does for more info.)

'devMode' => true,

Dev Mode should never be enabled in production environments.

defaultWeekStartDay #

AcceptsA number from 0 to 6 (where 0 represents Sunday and 6 represents Saturday)
Default0 (Sunday)
SinceCraft 2.5

The number representing the default Week Start Day preference value for new users.

environmentVariables #

AcceptsAn array of key/value string pairs
Defaultarray() (an empty array)
SinceCraft 1.1

An array of environment-specific variables which can be accessed as tags within URL and Path settings. (See Multi-Environment Configs for more info.)

'environmentVariables' => array(
    'baseAssetUrl'  => '//example.com/',
    'baseAssetPath' => './',
),

isSystemOn #

Acceptstrue, false, or null
Defaultnull
SinceCraft 2.1

Overrides the “System Status” setting in Settings → General if set to true or false.

'isSystemOn' => false,

logDumpMethod #

AcceptsA valid method name, callable, or function.
Default'var_export'
SinceCraft 2.3

A callable or function which will be used to dump context information. This setting will get passed directly to CLogFilter::$dumper.

'logDumpMethod' => 'print_r',

overridePhpSessionLocation #

Acceptstrue, false, 'auto', or the path to a custom session save path
Defaultfalse
SinceCraft 1.0

Determines whether Craft should override PHP’s session storage location to your craft/storage/ folder, or save session files in a custom location.

When set to true, Craft will override the location; false will tell Craft to leave the location alone and let PHP store the session where it was configured to.

When set to 'auto', Craft will check the default session location to see if it contains “://”, indicating that it might be stored with Memcache or the like. If it does, Craft will leave it alone; otherwise Craft will override it.

'overridePhpSessionLocation' => 'tcp://127.0.0.1:1234',

If you are saving PHP session files to a custom location using memcache (or something similar), you still need to tell PHP about it from Craft’s index.php in your public HTML folder.

ini_set('session.save_handler', 'memcached');

phpMaxMemoryLimit #

AcceptsAn integer setting the number of bytes, or a string set to a valid PHP shorthand byte value
Default'256M' (256 MB)
SinceCraft 1.0

The maximum amount of memory Craft will try to reserve during memory intensive operations such as zipping, unzipping and updating.

'phpMaxMemoryLimit' => '512M',

phpSessionName #

AcceptsA string of alphanumeric characters
Default'CraftSessionId'
SinceCraft 2.4

The name of the PHP session cookie Craft will use. (This value will get passed to session_name()).

'phpSessionName' => 'PHPSESSID',

runTasksAutomatically #

Acceptstrue or false
Defaulttrue
SinceCraft 2.3.2632

Whether Craft should run pending background tasks automatically over HTTP requests, or leave it up to something like a Cron job to call index.php/actions/tasks/runPendingTasks at a regular interval.

This setting should be disabled for servers running Win32, or with Apache’s mod_deflate/mod_gzip installed, where PHP’s flush() method won’t work.

If disabled, an alternate task running trigger must be set up separately. For example, this Cron command would trigger a task runner once every minute:

*/1 * * * * /usr/bin/curl --silent --compressed http://example.com/index.php?p=actions/tasks/runPendingTasks

sendPoweredByHeader #

Acceptstrue or false
Defaulttrue
SinceCraft 2.4

Whether the X-Powered-By: Craft CMS header should be sent along with each request.

'sendPoweredByHeader' => false,

siteName #

AcceptsA string, or an array that maps locale IDs to locale-specific strings.
Defaultnull
SinceCraft 2.3

Your site’s name. If this is set, it will take precedence over the Site Name setting in Settings → General.

'siteName' => array(
    'en' => 'On the Rocks',
    'es' => 'Con Hielo'
),

siteUrl #

AcceptsA string set to any valid URL, or an array that maps locale IDs to locale-specific URLs
Defaultnull
SinceCraft 2.0

Your site’s URL. If this is set, it will take precedence over the Site URL setting in Settings → General, as well as the CRAFT_SITE _URL constant, if set.

This is the recommended way to set the site URL on multi-lingual sites, as it gives Craft a way of knowing the correct URLs it should point localized entries/categories to.

'siteUrl' => array(
    'en' => 'http://example.com/',
    'de' => 'http://example.de/'
),

timezone #

AcceptsA string set to a valid PHP timezone.
Defaultnull
SinceCraft 2.3

The system timezone. If this is set, it will take precedence over the Timezone setting in Settings → General.

'timezone' => 'America/Los_Angeles',

translationDebugOutput #

Acceptstrue or false
Defaultfalse
SinceCraft 1.0

Tells Craft whether to surround all strings that are ran through Craft::t() or the |translate filter with “@” symbols, to help find any strings that are not being translated.

'translationDebugOutput' => true,

useCompressedJs #

Acceptstrue or false
Defaulttrue
SinceCraft 1.0

Tells Craft whether to use compressed Javascript files whenever possible, to cut down on page load times.

'useCompressedJs' => false,

useWriteFileLock #

Acceptstrue or false, or 'auto'
Default'auto'
SinceCraft 2.0

Whether to grab an exclusive lock on a file when writing to it by using the LOCK_EX flag.

Some file systems, such as NFS, do not support exclusive file locking.

When set to 'auto', Craft will automatically try to detect if the underlying file system supports exclusive file locking and cache the results.

'useWriteFileLock' => true,

useXSendFile #

Acceptstrue or false
Defaultfalse
SinceCraft 1.0

Whether Craft should use XSendFile to serve files when possible.

'useXSendFile' => true,

Security #

csrfTokenName #

AcceptsA string
Default'CRAFT_CSRF_TOKEN'
SinceCraft 2.2

The name that Craft should give CSRF cookies, and which getCsrfInput() will give to the input it returns, if CSRF Protection is enabled.

'csrfTokenName' => 'CSRF',

defaultFilePermissions #

AcceptsA valid PHP file permission mode
Default0664
SinceCraft 2.2

The permissions Craft will use when creating a new file on the file system.

'defaultFilePermissions' => 0744,

defaultFolderPermissions #

AcceptsA valid PHP file permission mode
Default0775
SinceCraft 1.0

The default permissions Craft will use when creating a new folder on the file system.

'defaultFolderPermissions' => 0744,

defaultTokenDuration #

AcceptsA string set to any valid PHP interval specification
Default'P1D' (one day)
SinceCraft 2.1

The default duration that system tokens should last for.

'defaultTokenDuration' => 'P1W',

enableCsrfProtection #

Acceptstrue or false
Defaultfalse
SinceCraft 2.2

Whether CSRF Protection should be enabled for the site.

'enableCsrfProtection' => true,

This setting will be set to true by default in Craft 3.0.

preventUserEnumeration #

Acceptstrue or false
Defaultfalse
SinceCraft 2.6.2848

Prevents “Forgot Password” forms from revealing whether a valid email address was entered, so even if the email was invalid, a “Password reset email sent” message will be displayed.

'preventUserEnumeration' => true,

tokenParam #

AcceptsA string set to any valid query string parameter name
Default'token'
SinceCraft 2.1

The query string parameter name that Craft should use for system tokens.

'tokenParam' => 't',

useSslOnTokenizedUrls #

Acceptstrue, false, or 'auto'
Default'auto'
SinceCraft 2.6.2793

Whether tokenized URLs (email verification links, entry draft sharing links, etc.) should begin with https or not. When set to 'auto', https will be used if either the base site URL or the current URL have https.

'useSslOnTokenizedUrls' => true,

useSecureCookies #

Acceptstrue, false, or 'auto'
Default'auto'
SinceCraft 2.3.2639

Whether Craft should set the secure flag on its cookies, limiting them to only be sent on secure (SSL) requests.

If this is set to 'auto', it will resolve to true or false depending on whether the current request is secure.

validateUnsafeRequestParams #

Acceptstrue or false
Defaultfalse
SinceCraft 2.6.2945

If set to true, the following request parameters will need to be hashed to ensure they weren’t tampered with:

  • all redirect parameters
  • possibly 3rd party plugin parameters
'validateUnsafeRequestParams' => true,

To hash a value from a Twig template, you can pass it through the |hash filter. For example:

<input type="hidden" name="redirect" value="{{ 'my-page'|hash }}">

Enabling this will prevent certain Denial of Service (DoS) attack vectors. As an added benefit, Twig will no longer operate in Safe Mode when otherwise-unsafe input values.

validationKey #

AcceptsString
Defaultnull
SinceCraft 2.5

Overrides the auto-generated secure validation key used to verify that hashed values have not been tampered with.

This should be set on load-balanced environments, or servers where the craft/storage/runtime folder is purged on a regular basis. If you are going to set this, make sure to set it to a private, random, cryptographically secure key. In a load-balanced environment, make sure you use the same key on all servers in the cluster.

'validationKey' => '6#AYD6jW6nUJ3GMfreeXcPTGmBu.V*3Fi?f',

I know what you’re thinking... “I’ll just copy the key they used in their example and use it as my own.” Don’t do that. Use something like https://www.grc.com/passwords.htm to generate a cryptographically secure key just for yourself!


Updates #

allowAutoUpdates #

Acceptstrue, 'minor-only', 'build-only', or false
Defaulttrue
SinceCraft 2.0

If set to true, all Craft updates will be auto-updatable.

If set to 'minor-only', then only minor updates and build updates will be auto-updatable; if a new major version comes out, the Updates page will only have a “Download” button, not an “Updates” button.

If set to 'build-only', then only build updates will be auto-updatable; if a new major or minor version comes out, the Updates page will only have a “Download” button, not an “Updates” button.

If set to false, no updates will be auto-updatable.

'allowAutoUpdates' => 'minor-only',

backupDbOnUpdate #

Acceptstrue or false
Defaulttrue
SinceCraft 1.0

Whether Craft should backup the database when updating. This applies to both auto and manual updates.

'backupDbOnUpdate' => false,

restoreDbOnUpdateFailure #

Acceptstrue or false
Defaulttrue
SinceCraft 1.0

Whether Craft should attempt to restore the just-created DB backup in the event that there was an error making the database schema changes mandated by the update.

'restoreDbOnUpdateFailure' => false,

showBetaUpdates #

Acceptstrue or false
Defaultfalse
SinceCraft 2.4.2688

Whether Craft should show Beta updates on the Updates page, when available.

'showBetaUpdates' => true,

URLs #

actionTrigger #

AcceptsA string set to any valid URI segment
Default'actions'
SinceCraft 1.0

The URI segment Craft should look for when determining if the current request should first be routed to a controller action.

'actionTrigger' => 'ACT',

addTrailingSlashesToUrls #

Acceptstrue or false
Defaultfalse
SinceCraft 2.0

Whether dynamically-generated URLs should include a trailing slash.

'addTrailingSlashesToUrls' => true,

allowUppercaseInSlug #

Acceptstrue or false
Defaultfalse
SinceCraft 2.1

Whether uppercase letters should be allowed in entry and category slugs. Note that this will not affect whether auto-generated slugs have uppercase letters (they won’t).

'allowUppercaseInSlug' => true,

baseCpUrl #

AcceptsA string or null
Defaultnull
SinceCraft 2.1

Explicitly sets the base URL to the control panel, which may be used if the dynamically-determined URL is not desired for some reason.

'baseCpUrl' => 'http://admin.example.com/',

cpTrigger #

AcceptsA string set to any valid URI segment
Default'admin'
SinceCraft 1.0

The URI segment Craft should look for when determining if the current request should route to the CP rather than the front-end website.

'cpTrigger' => 's3cret',

limitAutoSlugsToAscii #

Acceptstrue or false
Defaultfalse
SinceCraft 2.2

Limits automatically-generated slugs to ASCII characters. When there is an obvious ASCII version of a character (e.g. ñn), it will be used. Other characters will be removed.

'limitAutoSlugsToAscii' => true,

maxSlugIncrement #

AcceptsA positive integer
Default100
SinceCraft 2.2

The maximum number of increments Craft will apply to a slug while searching for one that will result in an element having a unique URL, before giving up and throwing an error.

'maxSlugIncrement' => 200,

omitScriptNameInUrls #

Acceptstrue, false, or 'auto'
Default'auto'
SinceCraft 1.0

Whether Craft should omit the script filename currently being used to access Craft (e.g. index.php) when generating URLs.

When set to 'auto', Craft will do its best to determine whether the server is set up to support index.php redirects, and cache the test’s results for 24 hours.

'omitScriptNameInUrls' => true,

pageTrigger #

AcceptsA URI-safe string, or a query string parameter name
Default'p'
SinceCraft 1.0

The string preceding a number which Craft will look for when determining if the current request is for a particular page in a paginated list of pages.

'pageTrigger' => 'page/',

If you would prefer for the page number to be specified as a query string parameter, begin the config setting value with a ?, followed by the desired parameter name.

'pageTrigger' => '?page',

Note that ?p cannot be used here, as Craft already uses a p query string parameter to determine the requested path.

resourceTrigger #

AcceptsA string set to any valid URI segment
Default'cpresources'
SinceCraft 1.0

The URI segment Craft should look for when determining if the current request should route to a resource file, either in craft/app/resources/ or a plugin’s resources/ folder.

'resourceTrigger' => 'assets',

The default resourceTrigger value changed in Craft 2.0. In Craft 1.x it was 'resources'.

slugWordSeparator #

AcceptsA URI-safe string
Default'-' (a dash)
SinceCraft 2.0

The string Craft should use to separate words when generating entry/category slugs.

'slugWordSeparator' => '_',

usePathInfo #

Acceptstrue, false, or 'auto'
Default'auto'
SinceCraft 1.0

Whether Craft should specify the path using PATH_INFO or as a query string parameter when generating URLs that include “index.php”. (See Enabling PATH_INFO for more info.)

'usePathInfo' => true,

Templating #

cacheElementQueries #

Acceptstrue or false
Defaulttrue
SinceCraft 2.2

Whether element queries should be recorded when the {% cache %} tag is doing its thing. If this is set to false, it will be up to you to clear caches manually when making changes that would result in an element showing up within a {% cache %} tag where it would not have before (such as creating new entries).

This will also prevent the “Deleting stale template caches” background task from running each time an element is saved.

'cacheElementQueries' => false,

defaultTemplateExtensions #

AcceptsAn array of strings identifying the file extensions
Defaultarray('html', 'twig')
SinceCraft 1.1

The template file extensions Craft will look for when matching a template path to a file on the front end. (Also see indexTemplateFilenames.)

'defaultTemplateExtensions' => array('html', 'htm', 'xhtml'),

enableTemplateCaching #

Acceptstrue or false
Defaulttrue
SinceCraft 2.4

Whether template caching via the {% cache %} tag should be enabled.

'enableTemplateCaching' => false,

errorTemplatePrefix #

AcceptsA string
Default''
SinceCraft 2.0

The path prefix to HTTP error code templates, like 404.html.

'errorTemplatePrefix' => "_errors/",

indexTemplateFilenames #

AcceptsAn array of strings identifying the filenames (sans extensions)
Defaultarray('index')
SinceCraft 1.1

The template filenames Craft will look for within a directory to represent the directory’s “index” template when matching a template path to a file on the front end. (Also see defaultTemplateExtensions.)

'indexTemplateFilenames' => array('index', 'default'),

privateTemplateTrigger #

AcceptsA string
Default'_'
SinceCraft 2.0

The prefix that can be placed before a template folder/file name to forbid direct HTTP traffic to it.

'privateTemplateTrigger' => "."

suppressTemplateErrors #

Acceptstrue or false
Defaultfalse
SinceCraft 2.5

Controls whether or not to show or hide any Twig template runtime errors that occur on the site in the browser. If it is set to true, the errors will still be logged to Craft’s log files.

'suppressTemplateErrors' => true

Users #

activateAccountFailurePath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Defaultnull
SinceCraft 1.2

The URI Craft should redirect to when user front-end account activation fails. Note that this only affects front-end site requests.

'activateAccountFailurePath' => 'members/activation-failed',

activateAccountSuccessPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Defaultnull
SinceCraft 2.3

The URI Craft should redirect to when a user is activated. Note that this only affects front-end site requests.

'activateAccountSuccessPath' => 'members/activation-success',

autoLoginAfterAccountActivation #

Acceptstrue or false
Defaultfalse
SinceCraft 2.1

Configures Craft to automatically log users in immediately after they’ve activated their accounts.

'autoLoginAfterAccountActivation' => true,

If your site allows public registration and users aren’t required to verify their email addresses, this setting will take effect immediately after new users register their accounts.

blowfishHashCost #

AcceptsAn integer
Default13
SinceCraft 1.2

The higher the cost value, the longer it takes to generate a password hash and to verify against it. Therefore, higher cost slows down a brute-force attack.

For best protection against brute force attacks, set it to the highest value that is tolerable on production servers.

The time taken to compute the hash doubles for every increment by one for this value. For example, if the hash takes 1 second to compute when the value is 14 then the compute time varies as 2^(value - 14) seconds.

'blowfishHashCost' => 14,

cooldownDuration #

AcceptsA string set to any valid PHP interval specification
Default'PT5M' (five minutes)
SinceCraft 1.0

The amount of time a user must wait before re-attempting to log in after their account is locked due to too many failed login attempts.

Set to false to keep the account locked indefinitely, requiring an admin to manually unlock the account.

'cooldownDuration' => false,

defaultCpLanguage #

AcceptsA string of a locale ID, or null
Defaultnull
SinceCraft 2.4

The default language that the Control Panel should be rendered in, for users that haven’t specified their Preferred Locale.

'defaultCpLanguage' => 'en',

deferPublicRegistrationPassword #

Acceptstrue or false
Defaultfalse
SinceCraft 2.6.2949

When set to true, public user registration forms will no longer need to include a password input. Users will have the opportunity to set their password after verifying their email address, if “Verify email addresses?” is enabled in Settings → Users → Settings.

'deferPublicRegistrationPassword' => true,

elevatedSessionDuration #

AcceptsA string set to any valid PHP interval specification or false
Default'PT5M' (Five minutes)
SinceCraft 2.6.2784

The amount of time a user’s elevated session will last, which is required for some sensitive actions (e.g. user group/permission assignment).

Elevated Sessions functionality can be disabled entirely by setting this to false. We don’t recommend actually doing this unless you have a good reason to!

invalidLoginWindowDuration #

AcceptsA string set to any valid PHP interval specification
Default'PT1H' (one hour)
SinceCraft 1.0

The amount of time to track invalid login attempts for a user, for determining if Craft should lock an account.

'invalidLoginWindowDuration' => 'PT10M',

invalidUserTokenPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Default'' (an empty string)
SinceCraft 2.3

The URI Craft should redirect to when user token validation fails.

'invalidUserTokenPath' => 'members/invalidtoken',

loginPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Default'login'
SinceCraft 1.0

The URI Craft should use for user login on the front-end.

'loginPath' => 'members/login',

logoutPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Default'logout'
SinceCraft 1.0

The URI Craft should use to log out users on the front-end of the site.

'logoutPath' => 'members/logout',

maxInvalidLogins #

AcceptsAny integer, or false
Default5
SinceCraft 1.0

The number of invalid login attempts Craft will allow within the specified duration before the account gets locked. If it is set to 0 or false, Craft will not enforce any maximum (not recommended on production).

'maxInvalidLogins' => false,

postCpLoginRedirect #

AcceptsA string
Default'dashboard'
SinceCraft 2.2

The path that users should be redirected to after logging in from the Control Panel.

This setting will also come into effect if the user visits the CP’s Login page when they are already logged in, or the CP’s root URL (e.g. /admin).

'postCpLoginRedirect' => 'entries',

postLoginRedirect #

AcceptsA string
Default'' (An empty string, which will give you the site homepage)
SinceCraft 2.2

The URL or path that users should be redirected to after logging in from the front-end site.

This setting will also come into effect if the user visits the site’s Login page (as specified by loginPath) when they are already logged in.

'postLoginRedirect' => 'members/home',

purgePendingUsersDuration #

AcceptsA string set to any valid PHP interval specification, or false to disable the feature
Defaultfalse
SinceCraft 2.1

The amount of time to wait before Craft purges pending users from the system that have not activated. Set to false to disable this feature. Note that if you set this to a time interval, then any content assigned to a pending user will be deleted as well when the given time interval passes.

'purgePendingUsersDuration' => 'P1M',

rememberUsernameDuration #

AcceptsA string set to any valid PHP interval specification
Default'P1Y' (1 year)
SinceCraft 1.0

The amount of time Craft will remember a username and pre-populate it on the CP login page.

Set to false to disable this feature altogether.

'rememberUsernameDuration' => false,

rememberedUserSessionDuration #

AcceptsA string set to any valid PHP interval specification
Default'P2W' (two weeks)
SinceCraft 1.0

The amount of time a user stays logged in if “Remember Me” is checked on the login page.

Set to false to disable the “Remember Me” feature altogether.

'rememberedUserSessionDuration' => false,

requireMatchingUserAgentForSession #

Acceptstrue or false
Defaulttrue
SinceCraft 1.0

Whether Craft should require a matching user agent string when restoring a user session from a cookie.

'requireMatchingUserAgentForSession' => false,

requireUserAgentAndIpForSession #

Acceptstrue or false
Defaulttrue
SinceCraft 1.0

Whether Craft should require the existence of a user agent string and IP address when creating a new user session.

'requireUserAgentAndIpForSession' => false,

setPasswordPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Default'setpassword'
SinceCraft 1.0

The URI and template path that Craft should use for user password resetting. Note that this only affects front-end site requests, and Password Reset emails will only use this setting for users that don’t have access to the Control Panel.

'setPasswordPath' => array(
    'en' => 'password',
    'de' => 'passwort'
),

setPasswordSuccessPath #

AcceptsA string set to any valid URI, or an array that maps locale IDs to locale-specific URIs
Default''
SinceCraft 1.1

The URI Craft should use upon successfully setting a users’s password. Note that this only affects front-end site requests.

'setPasswordSuccessPath' => array(
    'en' => 'password/success',
    'de' => 'passwort/erfolg'
),

testToEmailAddress #

Accepts A string set to a valid email address, or an array of email addresses.
Defaultnull
SinceCraft 1.0

Configures Craft to send all system emails to a single email address (or multiple email addresses), for testing purposes.

'testToEmailAddress' => 'me@example.com',

useEmailAsUsername #

Acceptstrue or false
Defaultfalse
SinceCraft 2.1

Removes “Username” fields in the control panel, and automatically saves users’ usernames based on their email addresses.

'useEmailAsUsername' => true,

userSessionDuration #

Acceptsfalse or a string set to any valid PHP interval specification
Default'PT1H' (one hour)
SinceCraft 1.0

The amount of time a user stays logged in.

Set to false if you want users to stay logged in as long as their browser is open rather than a predetermined amount of time.

verificationCodeDuration #

AcceptsA string set to any valid PHP interval specification
Default'P1D' (one day)
SinceCraft 1.0

The amount of time a user verification code can be used before expiring.

'verificationCodeDuration' => 'P1M',

Assets #

allowedFileExtensions #

AcceptsA string of a comma-separated list of file extensions.
Default'7z, aiff, asf, avi, bmp, csv, doc, docx, fla, flv, gif, gz, gzip, htm, html, jpeg, jpg, js, mid, mov, mp3, mp4, m4a, m4v, mpc, mpeg, mpg, ods, odt, ogg, ogv, pdf, png, potx, pps, ppsm, ppsx, ppt, pptm, pptx, ppz, pxd, qt, ram, rar, rm, rmi, rmvb, rtf, sdc, sitd, svg, swf, sxc, sxw, tar, tgz, tif, tiff, txt, vob, vsd, wav, webm, wma, wmv, xls, xlsx, zip'
SinceCraft 1.0

A list of file extensions that Craft will allow when a user is uploading files. Note that if you only want to add additional file extensions, without overriding the default extensions, you can use extraAllowedFileExtensions instead.

'allowedFileExtensions' => 'jpg, jpeg, png, gif',

convertFilenamesToAscii #

Acceptstrue or false
Defaultfalse
SinceCraft 2.4

Whether Craft should convert any non-ASCII characters in uploaded file names to ASCII.

'convertFilenamesToAscii' => true,

defaultImageQuality #

AcceptsA numeric value between 0 and 100, 0 being the lowest quality and smallest file size, and 100 being the highest quality and largest file size
Default75
SinceCraft 1.1

The default quality Craft will use when creating image transforms. Note that this can be overridden on a per-transform basis.

'defaultImageQuality' => 90,

extraAllowedFileExtensions #

AcceptsA string of a comma-separated list of file extensions.
Default''
SinceCraft 2.0

A list of additional file extensions that Craft will allow when a user is uploading files, which will get appended to the list specified by allowedFileExtensions.

'extraAllowedFileExtensions' => 'log',

filenameWordSeparator #

AcceptsA string or null
Default'-' (a dash)
SinceCraft 2.2

The string that should replace spaces in filenames after a file has been uploaded. If it is set to null, spaces will be left alone.

'filenameWordSeparator' => '_',

generateTransformsBeforePageLoad #

Acceptstrue or false
Defaultfalse
SinceCraft 2.1

Configures Craft to generate new image transforms right when getUrl() is called, rather than when the browser first requests the image.

'generateTransformsBeforePageLoad' => true,

imageDriver #

Accepts"gd", "imagick", or null
Defaultnull
SinceCraft 2.2

Forces Craft to use a specific image manipulation library.

'imageDriver' => 'gd',

maxCachedCloudImageSize #

AcceptsAn integer
Default2000
SinceCraft 1.2

The maximum size in pixels (length or width) Craft should use when caching images from external sources, which it uses to speed up transform generation. Set to 0 if you don’t want Craft to cache them at all.

'maxCachedCloudImageSize' => 2880,

maxUploadFileSize #

AcceptsA integer
Default16777216 (16MB)
SinceCraft 2.1

The maximum file size (in bytes) Craft should allow users to upload.

'maxUploadFileSize' => 33554432,

preserveImageColorProfiles #

Acceptstrue or false
Defaulttrue
SinceCraft 2.5

Whether the embedded color profiles should be preserved when uploading an image.

'preserveImageColorProfiles' => false,

rotateImagesOnUploadByExifData #

Acceptstrue or false
Defaulttrue
SinceCraft 2.3

Whether Craft should rotate images according to their EXIF data on upload.

This setting takes effect when images are uploaded with an “Orientation” entry in their EXIF data, which informs Craft that the image was taken by a camera while it was held sideways. When the setting is enabled, Craft will look for that EXIF entry on images as they’re uploaded, and if present, automatically rotate the image accordingly and strip out that Orientation entry.

'rotateImagesOnUploadByExifData' => true,

Tags #

allowSimilarTags #

Acceptstrue or false
Defaultfalse
SinceCraft 2.6.2791

Whether Craft should allow multiple tags to exist with names that would be identical if converted down to ASCII (e.g. Protéines, Proteines).

'allowSimilarTags' => true,