The configuration.php File
On this page
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:
Variable | Description | Example |
---|---|---|
allow_external_login_forms | Whether to allow other pages to use the login form. | $allow_external_login_forms = true; |
api_access_key | The 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_hash | A 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_dir | The path to the cron directory, if you have moved it. | $crons_dir = '/home/username/whmcs_crons/'; |
customadminpath | The path to the admin directory, if you have renamed it. | $customadminpath = "example"; |
db_host | The database’s hostname. | $db_host = "localhost"; |
db_name | The database name. | $db_name = ""; |
db_password | The database password. | $db_password = "12345luggage"; |
db_tls_ca | The path to the CA .pem file (for example, /var/www/html/whmcs/ca.pem ), if you use an encrypted MySQL® connection. | |
db_tls_ca_path | The path to the directory that contains the CA certificate files, if you use an encrypted MySQL connection. | |
db_tls_cert | The path to the client’s certificate, if you use an encrypted MySQL connection. | |
db_tls_cipher | A 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_key | The path to the client’s key, if you use an encrypted MySQL connection. | |
db_tls_verify_cert | Disable (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_username | The database user’s username. | $db_username = "example"; |
disable_admin_ticket_page_counts | Whether 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_summary | Whether 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_errors | Whether 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; |
DomainMaxLengthRestrictions | A maximum length restriction for domains. | $DomainMaxLengthRestrictions[".asia"] = 64; |
DomainMinLengthRestrictions | A minimum length restriction for domains. | $DomainMinLengthRestrictions[".ws"] = 4; |
DomainRenewalGracePeriods | The length for domain renewal grace periods. | $DomainRenewalGracePeriods[".com"] = "40"; |
DomainRenewalMinimums | The number of days before expiration during which you can renew a domain. | $DomainRenewalMinimums[".co.uk"] = "180"; |
enable_safe_include | Whether to override certain settings for encoded file loading. | $enable_safe_include = false; |
license | The full WHMCS license key. | $license = "12345"; |
overidephptimelimit | The 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_debug | Whether to log email piping errors to the Ticket Mail Import Log at Configuration () > System Logs. | $pop_cron_debug = true; |
session_handling | The type of session handling to use. | $session_handling = 'database'; |
templates_compiledir | The 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: October 30, 2024