- Joomla 4 Configuration.php File
- Where is the configuration.php File Located?
- What’s in the Joomla 4 configuration.php?
- Maintenance Message:
- Site Data:
- Debug Settings
- Database Information
- Server Settings
- Site Caching:
- Meta Info:
- SEO
- Site Feed
- Server Cache
- Cross-Origin Resource Sharing (CORS)
- Proxy Settings
- Mass Mail Settings
- Meta Rights Setting
- Cache Server Info
- Logging Settings
- Custom Logging
- Cookie Settings
- Redis Server Auth Settings
- Правильная настройка файла configuration.php в Joomla
- Настройка файла конфигурации
- Обязательные значения
- Заключение
- Похожие материалы:
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.
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:
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:
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:
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:
public $force_ssl = 0; public $live_site = ''; public $secret = 'cah3tl8ju3ynyiuq'; public $gzip = false; public $error_reporting = 'default'; public $helpurl = 'https://help.joomla.org/proxy?keyref=Help:&lang='; 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:
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:
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:
public $MetaDesc = 'My Joomla CMS'; public $MetaAuthor = true; public $MetaVersion = false; public $robots = '';
SEO
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:
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:
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:
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:
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:
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:
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:
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:
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 is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.
Правильная настройка файла configuration.php в Joomla
Файл конфигурации — это файл, необходимый для запуска сайта на текущем веб-сервере. Данный файл хранит в себе технические данные, правильность заполнения которых должна быть строго учтена.
Изменение конфигурации — один из этапов публикации сайта в Интернет, поэтому данная конфигурация изменяется обязательно после выхода в сеть.
Настройка файла конфигурации
Файл расположен в корневой папке сайта и называется — configuration.php. Чтобы внести изменения в файл, необходимо открыть его с помощью любого редактора.
Внутренняя часть файла выглядит следующим образом:
Чтобы изменять текущие значения, необходимо убедиться в том, что файл доступен к записи. Для этого запустить ftp — менеджер выделите файл и вызовите пункт — права доступа к файлу.
Правильное значение параметра прав — 644.
Обязательные значения
Чтобы настроить работу сайта, необходимо указать лишь несколько значений.
1) $host — имя хоста
2) $user — имя пользователя БД
3) $password — пароль от БД
5) $log_path — путь до файлов логов
6) $tmp_path — путь до временных файлов
Данные значения предоставляет хостинг-компания, которой вы сейчас пользуетесь.
Имя хоста в большинстве случаев остаётся localhost, но можно и уточнить в панели управления.
Имя пользователя БД, пароль БД это те значения, которые создаются при добавлении нового пользователя в разделе БД MySQL хостинг-компании.
В названии от БД указывается та база, которая была предварительно создана для текущего сайта в панели хостинг-компании.
Путь до файлов логов указывается в полном наименовании от корневой директории сервера — /logs.
Путь до временных файлов, аналогично — /tmp.
Чтобы узнать путь корневой директории, необходимо перейти в административный пункт «Информация о системе«.
В раздел: «Информация о PHP«.
Данный путь указан, напротив DOCUMENT_ROOT.
Заключение
Все перечисленные значения переменных, при необходимости, можно поменять и в административной части сайта — в общих настройках.