The configuration.php File

The configuration.php file contains important settings for your WHMCS installation. In some circumstances, you will need to update it manually, or you may need to recreate it.

  • We recommend additional steps to secure the important information in the configuration.php file. For more information, see Secure the Configuration File.
  • You can supply the configuration file data as a JSON string when you install WHMCS on the command line. For more information, see Install on the Command Line.

Configuration File Variables

This is not an exhaustive list of the potential variables within the configuration.php file. For assistance in determining the values you need, contact your hosting provider or system administrator.

The configuration.php file may contain the following variables:

VariableDescriptionExample
allow_external_login_formsWhether to allow other pages to use the login form.$allow_external_login_forms = true;
api_access_keyThe installation’s API access key. You will need this key if you want to use the WHMCS Mobile Apps.$api_access_key = "abc123";
cc_encryption_hashA random 50-character string that contains numbers, uppercase letters, and lowercase letters.
If you lose the encryption hash value, the system won’t be able to decrypt your data. Make certain that you back up this value.
$cc_encryption_hash = "";
crons_dirThe path to the cron directory, if you have moved it.$crons_dir = '/home/username/whmcs_crons/';
customadminpathThe path to the admin directory, if you have renamed it.$customadminpath = "example";
db_hostThe database’s hostname.$db_host = "localhost";
db_nameThe database name.$db_name = "";
db_passwordThe database password.$db_password = "12345luggage";
db_tls_caThe path to the CA .pem file (for example, /var/www/html/whmcs/ca.pem), if you use an encrypted MySQL® connection.
db_tls_ca_pathThe path to the directory that contains the CA certificate files, if you use an encrypted MySQL connection.
db_tls_certThe path to the client’s certificate, if you use an encrypted MySQL connection.
db_tls_cipherA list of one or more ciphers to use for SSL encryption, in an OpenSSL-compatible format, if you use an encrypted MySQL connection.
db_tls_keyThe path to the client’s key, if you use an encrypted MySQL connection.
db_tls_verify_certDisable (0) or enable (1) the server certificate, for encrypted MySQL connections.
If you set db_tls_verify_cert to 1 (enabled), the db_host value in the configuration.php file must match the Common Name (CN) or be a Subject Alternative Name (SAN) of the certificate that you specify for db_tls_cert.
db_usernameThe database user’s username.$db_username = "example";
disable_admin_ticket_page_countsWhether to disable the ticket counts that display on some pages in the Admin Area. Disabling this can help improve system performance if your installation contains a large number of support tickets.$disable_admin_ticket_page_counts = true;
disable_clients_list_services_summaryWhether to disable the service counts that display on some pages in the Admin Area. Disabling this can help improve system performance if your installation contains a large number of services.$disable_clients_list_services_summary = true;
display_errorsWhether to display additional information about errors that occur in WHMCS. We recommend only enabling this setting when you are actively troubleshooting issues.$display_errors = true;
DomainMaxLengthRestrictionsA maximum length restriction for domains.$DomainMaxLengthRestrictions[".asia"] = 64;
DomainMinLengthRestrictionsA minimum length restriction for domains.$DomainMinLengthRestrictions[".ws"] = 4;
DomainRenewalGracePeriodsThe length for domain renewal grace periods.$DomainRenewalGracePeriods[".com"] = "40";
DomainRenewalMinimumsThe number of days before expiration during which you can renew a domain.$DomainRenewalMinimums[".co.uk"] = "180";
enable_safe_includeWhether to override certain settings for encoded file loading.$enable_safe_include = false;
licenseThe full WHMCS license key.$license = "12345";
overidephptimelimitThe max_execution_time value to force for general requests, in seconds. By default, WHMCS forces a maximum execution time of 300 seconds, but you may need to increase this if you see certain timeout-related PHP errors.$overidephptimelimit = 500;
$pop_cron_debugWhether to log email piping errors to the Ticket Mail Import Log at Configuration () > System Logs.$pop_cron_debug = true;
session_handlingThe type of session handling to use.$session_handling = 'database';
templates_compiledirThe path to the templates_c directory, if you have moved it.$templates_compiledir = "templates_c/";

Example File

Your file should resemble the example below:

<?php
$license = "";
$db_host = "localhost";
$db_username = "";
$db_password = "";
$db_name = "";
$cc_encryption_hash = "";
$templates_compiledir = "templates_c/";

Last modified: June 14, 2024