Joomla 4 Configuration.php File

Learn About the Joomla 4 configuration.php File

The configuration.php file is used to control many aspects of your Joomla 4 site. In fact, all of the settings included in the file directly correlate to a Global Configuration setting in the Admin Panel of Joomla.

While it is possible to manage the Global Configuration settings in the Admin Panel, there may be instances where you don’t have access or it is faster to modify the setting directly in the configuration.php file.

This guide will help you understand how to locate and understand what is included in the Joomla 4 configuration.php file. We will also explain where the same setting can be modified in the Admin Panel.

Where is the configuration.php File Located?

The configuration.php file is located in the document root of your Joomla website. This is the location where your Joomla files are installed. For more information see the following guide.

Here is an example of what the contents of the configuration.php file looks like.

What’s in the Joomla 4 configuration.php?

We will now briefly go over the contents of a default configuration.php file. Then we will explain how to access these same settings in the Global Configuration section of the Admin Panel.

Maintenance Message:

The first settings you will see are related to the  maintenance settings for your site. These can be enabled in order to disable your site. This can be helpful when you are working on your site and don’t want people to access it.

Maintenance Setting Location:

System–>Global Configuration–>Site–>Site Offline

	public $offline = false;
	public $offline_message = 'This site is down for maintenance.<br />Please check back again soon.';
	public $display_offline_message = 1;
	public $offline_image = '';

Site Data:

This section includes basic information regarding your site such as the site name, text editor, and CAPTCHA setting.

Site Setting Location:

System–>Global Configuration–>Site–>Site

	public $sitename = 'My Joomla';
	public $editor = 'tinymce';
	public $captcha = '0';
	public $list_limit = 20;
	public $access = 1;

Debug Settings

The debugging settings for your Joomla 4 site are outlined in this next section. Debugging can provide helpful error information when you are troubleshooting website issues.

Debug Setting Location:

System–>Global Configuration–>System–>Debug

	public $debug = false;
	public $debug_lang = false;
	public $debug_lang_const = true;

Database Information

A very important section of the configuration.php file is the database information. If you are experiencing database connection issues, this is one of the first things you should check. Ensure the hostname, username, and password are correct. Also verify that they have permission to access the database.

Database Setting Location:

System–>Global Configuration–>Server–>Database

	public $dbtype = 'mysqli';
	public $host = 'localhost';
	public $user = 'custo123_joom778';
	public $password = 'verystrongpassword';
	public $db = 'custo123_joom778';
	public $dbprefix = 'josf4_';
	public $dbencryption = 0;
	public $dbsslverifyservercert = false;
	public $dbsslkey = '';
	public $dbsslcert = '';
	public $dbsslca = '';
	public $dbsslcipher = '';

Server Settings

This section includes some of the basic server settings such as forcing SSL, error reporting, and time setting.

Server Setting Location:

System–>Global Configuration–>Server–>Server

	public $force_ssl = 0;
	public $live_site = '';
	public $secret = 'cah3tl8ju3ynyiuq';
	public $gzip = false;
	public $error_reporting = 'default';
	public $helpurl = '{major}{minor}:{keyref}&lang={langcode}';
	public $offset = 'UTC';


The following options outline the mail settings for your Joomla site. Keep in mind that these will differ based on the specific settings you select for handling mail.

Mail Setting Location:

System–>Global Configuration–>Server–>Mail

	public $mailonline = true;
	public $mailer = 'mail';
	public $mailfrom = '[email protected]';
	public $fromname = 'My Joomla';
	public $sendmail = '/usr/sbin/sendmail';
	public $smtpauth = false;
	public $smtpuser = '';
	public $smtppass = '';
	public $smtphost = 'localhost';
	public $smtpsecure = 'none';
	public $smtpport = 25;

Site Caching:

Your site caching setup will be outlined next. Once again these will depend on your specific cache setup and the options you are utilizing.

Site Caching Setting Location:

System–>Global Configuration–>System–>Cache

	public $caching = 0;
	public $cache_handler = 'file';
	public $cachetime = 15;
	public $cache_platformprefix = false;

Meta Info:

In the meta section, you can choose how the metadata for your site will be served. For example, the meta description for your site as well as whether you display author information is outlined here.

Meta Info Location:

System–>Global Configuration–>Site–>Metadata

	public $MetaDesc = 'My Joomla CMS';
	public $MetaAuthor = true;
	public $MetaVersion = false;
	public $robots = '';


The search engine friendly (SEF) settings for your site are set in the next section. This can affect how the URL’s for your site will be displayed.

SEO Setting Location:

System–>Global Configuration–>Site–>SEO

	public $sef = true;
	public $sef_rewrite = false;
	public $sef_suffix = false;
	public $unicodeslugs = false;

Site Feed

This section includes basic site and feed limit setup information along with the path to the logs and temporary files.

Site Feed Setting Location:

System–>Global Configuration–>Site–>Site

	public $feed_limit = 10;
	public $feed_email = 'none';
	public $log_path = '/home/custo123/public_html/jpjoomla/administrator/logs';
	public $tmp_path = '/home/custo123/public_html/jpjoomla/tmp';
	public $lifetime = 15;
	public $session_handler = 'database';
	public $shared_session = false;
	public $session_metadata = true;

Server Cache

The next section will outline the specifics of memcache and/or redis. Keep in mind this will depend on your System Cache and Cache Handler setting.

Server Cache Setting Location:

System–>Global Configuration–>System–>Cache

	public $memcached_persist = true;
	public $memcached_compress = false;
	public $memcached_server_host = 'localhost';
	public $memcached_server_port = 11211;
	public $redis_persist = true;
	public $redis_server_host = 'localhost';
	public $redis_server_port = 6379;
	public $redis_server_db = 0;

Cross-Origin Resource Sharing (CORS)

CORS is the ability to share scripts or request from a different domain. This section includes the default settings for Joomla cross origin resource sharing.

CORS Setting Location:

System–>Global Configuration–>Server>Web Services

	public $cors = false;
	public $cors_allow_origin = '*';
	public $cors_allow_headers = 'Content-Type,X-Joomla-Token';
	public $cors_allow_methods = '';

Proxy Settings

If your site is utilizing a proxy server, the setup will be outlined in this section. Once again this will differ based on your server environment.

Proxy Setting Location:

System–>Global Configuration–>Server–>Proxy

	public $behind_loadbalancer = false;
	public $proxy_enable = false;
	public $proxy_host = '';
	public $proxy_port = '';
	public $proxy_user = '';

Mass Mail Settings

The Super Administrators can have the ability to send mass emails to all registered users. The settings for this are included in this section section.

Mass Mail Setting Location:

System–>Global Configuration–>Server–>Mail

	public $massmailoff = false;
	public $replyto = '';
	public $replytoname = '';

Meta Rights Setting

This section will include information regarding the rights of your site content. For example, it may include text such as ‘©2015-2021 Your company, Inc. All rights reserved’

Meta Rights Setting Location:

System–>Global Configuration–>Site–>MetaData

	public $MetaRights = '';
	public $sitename_pagetitles = 0;

Cache Server Info

This section contains more details about your memcache/redis server setup. This will only apply if you are utilizing these specific cache settings.

Cache Server Setting Location:

System–>Global Configuration–>System–>Cache

	public $session_filesystem_path = '';
	public $session_memcached_server_host = 'localhost';
	public $session_memcached_server_port = 11211;
	public $session_redis_persist = 1;
	public $session_redis_server_host = 'localhost';
	public $session_redis_server_port = 6379;
	public $session_redis_server_db = 0;
	public $frontediting = 1;
	public $block_floc = 1;

Logging Settings

This is where the extent of what your joomla site is logging is set. If these are set to the on or 1 setting, almost every event will be logged for your Joomla site.

Logging Setting Location:

System–>Global Configuration–>Logging–>Logging

	public $log_everything = 0;
	public $log_deprecated = 0;

Custom Logging

Changes to your log priorities and excluded categories will be listed here if applicable.

Custom Logging Setting Location:

System–>Global Configuration–>Logging–>Custom Logging

	public $log_priorities = array('0' => 'all');
	public $log_categories = '';
	public $log_category_mode = 0;

Cookie Settings

Your site’s cookie settings will be set in this next section, such as the domain and cookie path. Cookies are used for tracking visitors to your site.

Cookie Setting Location:

System–>Global Configuration–>Site–>Cookie

	public $cookie_domain = '';
	public $cookie_path = '';
	public $asset_id = '1';

Redis Server Auth Settings

If you are utilizing redis caching, the server authorization information will be included in this section.

Redis Auth Setting Location:

System–>Global Configuration–>System–>Cache–>System Cache ON–>Redis Cache Handler

	public $redis_server_auth = '';
	public $session_redis_server_auth = '';

Congratulations, now you know what is included in the Joomla configuration.php file, where to locate it, and how to find the setting in the Admin Panel. Check out our Joomla 4 section for more tutorials to help you build a successful website.

If you need an optimized solution for your Joomla site, check out our high performance Joomla Hosting plans.
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Let us know!