{kun´ēzē}
 
(Reading time: 7 - 13 minutes)
26Jun2023

Leave $live_site='' in Joomla configuration.php

Information
235 hits Updated: 27 June 2023 Blog

What is does this \(live_site thing do?

Be wary about “official documentation”

Some advice for people who use Akeeba Backup

There's a setting in the J! configuration file that has been there since J! 1.0; in a brand-new J! 4.x installation you will find it at around line 40 and it looks like this

	public \)live_site = '';
The [Forum Post Assistant tool] sometimes reports "Live Site is not empty" and experts here say it should be and to edit configuration.php to make it empty.  I have looked through the core Joomla code and … see that live_site is reported in the System Information » Configuration File tab.  [A non-empty value turns all URLs into 'garbage' that] makes the site unusable … but there is no place where it is set within Joomla.

I guess this is for some special purpose known only to a few.  Can anyone explain the intended use of this parameter?  How is it set other than by editing configuration.php?forum user, Joomla Forum, 15-Apr-2022

There is no mechanism within Joomla that allows a website owner to change this value. If people have a different value for \(live_site it is because they have edited the file configuration.php themselves.  There are literally hundreds of posts on technical forums that discuss problems people have with using a non-null value for \)live_siteHundreds of posts!  So, why do people use a non-null value for \(live_site especially when there’s no mechanism with J! to set or change it?

As Tim Davis explained in a video presentation a few years ago, there may have been a reason for using \)live_site but no-one seems to know why it’s there today.

In general, there are two main reasons for editing the file configuration.php.  One of those reasons is if you’re locked-out from the backend of your website and you need to enable J! debug mode; the other main reason is to verify (or change) the database credentials.  In general there should be no other reason to change this file.  Neither of these situations involves changing \(live_site.  Again, we have to ask the question, for what other reason do people edit configuration.php?

The problem with the “official” Joomla documentation

There are not many places on the internet where the \)live_site setting is properly explained.  The official Joomla documentationSource:  Common problems when enabling Search Engine Friendly (SEF) URLs retrieved 11-Dec-2022. discusses the “need” to change \(live_site:

Have You Moved Domains?

Sometimes if you have changed domains (for example, from a localhost or test environment to the live domain), you will need to edit the value for the \)live_site variable in the configuration.php file found in the root directory of your Joomla site files. The value of the variable must be manually edited, it cannot be accessed via the Global Configuration screens.

Typically, it would look like:

	var \(live_site = 'https://example.com';

Or, if you access your website in a sub-folder called joomla, it would be like this:

	var \)live_site = 'https://example.com/joomla';

When you move domains, this value may need updating to reflect your new domain name:

	var \(live_site = 'https://mynewdomain.com';

Often there is no need to specify this variable at all. Simply leave it blank:

	var \)live_site = '';

There are a lot of assumptions here. The first assumption is that there exists a non-null value for \(live_site, “typically” appearing as

	var \)live_site = 'https://example.com';

That assumption is false if the website being moved from one hosted environment to another (or one domain to another) had a non-null value there in the first place.  If the original website is a brand-new, “out-of-the-box” J! 4.x (or J! 3.x) website, the configuration.php file contains the line

	public \(live_site = '';

Secondly, the documentation is outdated.  The Joomla configuration.php file does not use var declarations; it uses public declarations.  I’m not sure when the change occurred but it was probably around the time of J! 3.5, I think (about six years ago) and the doco hasn’t been updated to reflect this change.

Thirdly, even on PC-hosted websites, there would typically be no need for a non-null value for \)live_site and, therefore, no need to change this when deploying the site to a commercially-hosted environment.

In A Guided Tour of Joomla’s configuration.php File, \(live_site is discussed here:

\)live_site:  In the newest versions this should not have a value.  There may be times you do need to fill in a value.  If you are redirecting a URL you need to put the actual URL to the live site on this line.  Or if you are creating a copy of a site for testing and modification.  For example, I have a test site at https://dashhelp.com/joomla17 which is a copy of my main site.  I had to change this line in the configuration.php file on the copy.  You will get a page not found error if this is not set to ‘https://yourdomain.com/directory” or in the case of a subdomain “https://subdomain.yourdomain.com”.  Joomla uses this URL to create relative paths.  Essential to check this on test sites.A Guided Tour of Joomla's configuration.php File, Steve Burge, 12-Jun-2019

I agree that it’s essential to check this setting on test sites; it’s essential to check this setting on all J! 4.x (or J! 3.x) websites because you will probably find that there is no need to have anything other than an non-null value for this setting. The above article was written over four years ago and some of the advice that it contains may be outdated.  In effect, \(live_site may be useful in situations where the website is hosted on a badly-configured server—which is a point made in the video I mentioned earlier—but there is no apparent reason why people need to change this value.

Again we return to the question, why do people change something that can’t be changed under normal circumstances?  What advice are people reading that instructs them to make these kinds of changes?  I don’t know the answers to all of these these questions but most experts would agree that there’s no benefit in changing \)live_site.I updated the documentation to include a warning about \(live_site.

The problem with Akeeba Backup

One reason why we see people having \)live_site with a non-empty value is because of the way they’ve restored their websites using Akeeba Backup.

Akeeba Backup Site Restoration ScriptAfter using Akeeba Kickstart to decompress the [Akeeba Backup] .JPA file, a new window opens and runs a slightly different form of the J! installation procedure.  On the second screen of this “installation”https://www.akeeba.com/documentation/akeeba-backup-documentation/angie-joomla-setup.html you will see a form (click the image on the right side of this page to enlarge it).

Note the fourth input text box labelled Live Site URL.  This should be left empty.  If you hover your mouse over label, you may see a warning, as shown below:

absrs02

We now know the reason why a number of people have websites with \(live_site = 'something'.There is more discussion about how happens at https://forum.joomla.org/viewtopic.php?f=808&t=998528.  In short—despite the overwhelming weight of expert opinion that people ignore—people look at a blank form on a screen and think they need to enter some value into it.

If anyone can show me a real life example of how changing \)live_site to a non-null value has made a positive improvement to their J! 4.x experience, I would be fascinated to know about it.  My advice is to leave $live_site alone or, if it has a non-null value, change it!

About the author:

has worked in the information technology industry since 1971 and, since retiring from the workforce in 2007, is a website hobbyist specialising in Joomla, a former member of the Kunena project for more than 8 years, and contributor on The Joomla Forum™. The opinions expressed in this article are entirely those of the author. View his profile here.


No thoughts on “Leave $live_site='' in Joomla configuration.php”

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 
Trending now