Cannot redeclare JConfig::$session_redis_server_host

Need help upgrading your Joomla! website or converting to Joomla! 3.x? Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
julos08
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Apr 06, 2009 6:02 pm

Cannot redeclare JConfig::$session_redis_server_host

Post by julos08 » Sat Dec 16, 2017 1:12 pm

Hello All,

Since the last update of Joomla (3.8.3) lot of my websites has a blank page error 500 with in the log :

AH01071: Got error 'PHP message: PHP Fatal error: Cannot redeclare JConfig::$session_redis_server_host in /home/mywebsite/public_html/configuration.php on line 95\n'

Thanks in advance for your support.
Last edited by toivo on Sun Dec 17, 2017 8:20 am, edited 1 time in total.
Reason: mod note: moved from the French forum, please post to the correct forum in the future

adrimac
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Mar 16, 2013 4:25 am

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by adrimac » Fri Jan 05, 2018 6:19 pm

I have this happening to my joomla site after the update to 3.8.3.
Fatal error: Cannot redeclare JConfig::$session_redis_server_host

Anyone have any answers, please?

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 5646
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by sozzled » Fri Jan 05, 2018 6:44 pm

See viewtopic.php?f=714&p=3506123

The standard (or "default") value for $session_redis_server_host in the configuration.php file is

Code: Select all

	public $session_redis_server_host = 'localhost';
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2176
Joined: Sun Feb 28, 2010 8:26 pm

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by mbabker » Fri Jan 05, 2018 9:45 pm

This means you have the declaration of that property in your configuration file twice (or possibly more, why I couldn't say but it's there). Remove the extra declarations.
So long and thanks for all the fish.

Manually updating Joomla? See https://gist.github.com/mbabker/d7bfb4e ... 3607f89281

CactusTom
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 11, 2018 2:08 am

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by CactusTom » Thu Jan 11, 2018 2:46 pm

I am not sure which lines I should delete.
Any thoughts and guidance?


public $session_memcache_server_host = 'localhost';
public $session_memcache_server_port = '11211';
public $session_memcached_server_host = 'localhost';
public $session_memcached_server_port = '11211';
public $session_redis_server_host = 'localhost';
public $session_redis_server_port = '6379';

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2176
Joined: Sun Feb 28, 2010 8:26 pm

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by mbabker » Thu Jan 11, 2018 5:07 pm

The key is in the error message. "Cannot redeclare JConfig::$session_redis_server_host". This means there are multiple declarations of the $session_redis_server_host property in the file. So you need to delete all the extras until there is only one. If there are any other duplicated properties, those will have to be removed as well.
So long and thanks for all the fish.

Manually updating Joomla? See https://gist.github.com/mbabker/d7bfb4e ... 3607f89281

User avatar
ribo
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3297
Joined: Sun Jan 03, 2010 8:47 pm
Contact:

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by ribo » Thu Jan 11, 2018 5:31 pm

Check the solution that @mbabker said. Redis works fine in joomla session. Tested.
chat room spontes : http://www.spontes.com

User avatar
daisysmom
Joomla! Intern
Joomla! Intern
Posts: 98
Joined: Tue Oct 16, 2007 12:34 pm

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by daisysmom » Fri Jan 12, 2018 9:38 pm

I have the same thing going on with one of my sites.
My error log says this:
[12-Jan-2018 20:59:24 UTC] PHP Fatal error: Cannot redeclare JConfig::$session_redis_server_host in /home/lexalum2/public_html/configuration.php on line 100

I see two mentions of the $session_redis_server_host but neither are on line 100

On Line 100 I see this: public $replytoname = '';

Any and all suggestions are greatly appreciated. Thank you!

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 5646
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by sozzled » Fri Jan 12, 2018 9:52 pm

@daisysmom: maybe you miscounted the line numbers?

The real question is this: do you have more than one occurrence of

Code: Select all

 	public $session_redis_server_host = 'something';
within the file configuration.php? Yes or no?

... and if you have two occurrences of these things, then delete one of them. That's the answer.
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

User avatar
daisysmom
Joomla! Intern
Joomla! Intern
Posts: 98
Joined: Tue Oct 16, 2007 12:34 pm

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by daisysmom » Sat Jan 13, 2018 12:44 am

Yes, there are two occurrences of public $session_redis_server_host = 'localhost';
I deleted one at a time and saved the file and checked site after each try with no change. Will the change be right away or does it have to propagate?

User avatar
ribo
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3297
Joined: Sun Jan 03, 2010 8:47 pm
Contact:

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by ribo » Sat Jan 13, 2018 11:14 am

daisysmom wrote:Yes, there are two occurrences of public $session_redis_server_host = 'localhost';
I deleted one at a time and saved the file and checked site after each try with no change. Will the change be right away or does it have to propagate?
You must have these values for session

Code: Select all

public $session_redis_server_host
	public $session_redis_server_port
	public $session_redis_persist 
	public $session_redis_server_auth
	public $session_redis_server_db 
If anyone is duplicated please delete it
chat room spontes : http://www.spontes.com

CactusTom
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 11, 2018 2:08 am

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by CactusTom » Sat Jan 13, 2018 1:26 pm

mbabker wrote:The key is in the error message. "Cannot redeclare JConfig::$session_redis_server_host". This means there are multiple declarations of the $session_redis_server_host property in the file. So you need to delete all the extras until there is only one. If there are any other duplicated properties, those will have to be removed as well.

User avatar
daisysmom
Joomla! Intern
Joomla! Intern
Posts: 98
Joined: Tue Oct 16, 2007 12:34 pm

Re: Cannot redeclare JConfig::$session_redis_server_host

Post by daisysmom » Sat Jan 13, 2018 2:53 pm

THANK YOU ALL!!
I have a working site again!!
Now, can anyone explain why the configuration file changes mysteriously? Is it a virus or a hack?

Thank you again SO much!!


Post Reply

Return to “Migrating and Upgrading to Joomla! 3.x”