Warning message. How to correct ?

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
User avatar
Viggo1
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Mar 19, 2008 11:02 am
Location: Vevey - Switzerland
Contact:

Warning message. How to correct ?

Postby Viggo1 » Thu Mar 20, 2008 6:45 pm

Hello,

I am setting the sections and when hitting save I get the following warning message:

Warning: Memcache::addserver() expects parameter 2 to be long, string given in /usr/var/www/html/eco60/html/joomla/libraries/joomla/cache/storage/memcache.php on line 83

On line 83 I can find:

// Create the memcache connection
$this->_db = new Memcache;
for ($i=0, $n=count($this->_servers); $i < $n; $i++)
{
$server = $this->_servers[$i];
$this->_db->addServer($server['host'], $server['port'], $this->_persistent);
}

With this error I can't insert into the template the section titles.

Many thanks for your help.

Regards.
Viggo + Pieter

dgdeleon08
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 21, 2008 10:48 pm

Memcache Warning message. PLEASE HELP

Postby dgdeleon08 » Fri Mar 21, 2008 11:37 pm

Warning: Memcache::addserver() expects parameter 2 to be long, string given in /Library/WebServer/Documents/dgllimbo/libraries/joomla/cache/storage/memcache.php on line 83

I have exactly the same problem and was hoping to get an answer through your posting. But time passes and I decided to second your call for help.
There is a thread (http://forum.joomla.org/viewtopic.php?f=433&t=272269&p=1227193) that proposes a way out but it did not work for me... the system complains even more.

My fresh installation worked fine for a few minutes until I defined the first section.. then the error message appeared!

I do hope that it can be fixed easily.

Cheers

dgdeleon08
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 21, 2008 10:48 pm

Re: Warning message. How to correct ?

Postby dgdeleon08 » Fri Mar 21, 2008 11:43 pm

Hello again,

I have edited out lines 79 to 84 of the file joomla/libraries/joomla/cache/storage/memcache.php, and the error has disappeared without, so far, any further errors.
Will keep posting if I do find an error or warning.

Cheers

User avatar
Viggo1
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Mar 19, 2008 11:02 am
Location: Vevey - Switzerland
Contact:

Re: Warning message. How to correct ?

Postby Viggo1 » Sat Mar 22, 2008 7:22 am

Many thanks for your answers ;D

I have finally found how to correct this problem.

In the backend----> Configuration ----->System

On the right side there are settings for the cache.

In Port: I have put the value 0

....and it worked. No error message anymore.

Regards
Viggo + Pieter

dgdeleon08
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 21, 2008 10:48 pm

Re: Warning message. How to correct ?

Postby dgdeleon08 » Sat Mar 22, 2008 6:12 pm

Thank you very much! It does work! ;)

However, I tried other port numbers and it also seems to work...
Do you have any ideas as to the correct setting?

Cheers!

z33k3r
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Mar 23, 2006 4:42 am

Re: Warning message. How to correct ?

Postby z33k3r » Wed Apr 30, 2008 9:22 pm

Thank you very much for the tip on the port number fix. This is an odd quirk that happens. I suspect that the reason any port number works is due to the fact that you are not using a caching server. Since the feature is disabled, there is no error thrown. ;)

Lubos
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Apr 01, 2008 7:33 pm

Thanks viggo1

Postby Lubos » Sat May 03, 2008 8:29 am

Many thanks viggo1, it worked for me as well. I really appreciate that you found time to come back to your post and post your findings.
I used Drupal and it being less user-friendly than Joomla, I had to look onto forums often. Good thing was that there was a lot answers and fast answers. This is not the case here on Joomla forums. Lots of questions has no answers. I have 2 other posts, one has 0 answers, second I answered myself when I found out how to solve it.
IMHO Joomla is much more user-friendly than Drupal, however the forums are much less user-friendly than Drupal's forums.

Tarkin000
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue May 27, 2008 3:10 pm

Re: Warning message. How to correct ?

Postby Tarkin000 » Tue May 27, 2008 3:22 pm

I haven't searched all the forums yet, and I'm NOT a php programmer, but this worked for me.
change the code on line 83 from :

Code: Select all

$this->_db->addServer($server['host'], $server['port'], $this->_persistent);


to :

Code: Select all

$this->_db->addServer($server['host'], (int)$server['port'], $this->_persistent);
                                        ^^^^ see the cast to int?


Hope it helps someone. Though, if/when I actually globally enable memcache,
the other stuff I've read here should help alot.

TTFN,
Tarkin000

Nica521
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Mar 29, 2008 11:46 am

Re: Warning message. How to correct ?

Postby Nica521 » Sat Jul 05, 2008 1:26 pm

Hey Guys,

I had the same issues. I fixed my problem by changing the cache handler in Config -> System to be "File". I believe this should be the default setting, and for whatever reason it changed to memcache.

Cheers,
Nica521

techsathish
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Oct 16, 2008 5:52 am

Re: Warning message. How to correct ?

Postby techsathish » Thu Oct 16, 2008 5:57 am

:) ;) Many thanks viggo1, it worked for me as well. I really appreciate that you found time to come back to your post and post your findings. ;) :)

profomar
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Dec 19, 2008 12:10 pm

Re: Warning message. How to correct ?

Postby profomar » Fri Dec 19, 2008 12:17 pm

The "File" option only appears if the folder /cache in the Joomla directory was "777 chmoded"

:D

User avatar
ashain
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 165
Joined: Wed Apr 29, 2009 8:23 am
Location: Dubai- U.A.E
Contact:

Re: Warning message. How to correct ?

Postby ashain » Fri Jul 17, 2009 9:38 pm

Tarkin000 wrote:I haven't searched all the forums yet, and I'm NOT a php programmer, but this worked for me.
change the code on line 83 from :

Code: Select all

$this->_db->addServer($server['host'], $server['port'], $this->_persistent);


to :

Code: Select all

$this->_db->addServer($server['host'], (int)$server['port'], $this->_persistent);
                                        ^^^^ see the cast to int?


Hope it helps someone. Though, if/when I actually globally enable memcache,
the other stuff I've read here should help alot.

TTFN,
Tarkin000


Thanks A lot Its worked for me..zionhills.net
Thanks to Joomla made my web development EASY,

http://zionhills.org
http://sinhalaholybible.com

dahaleuday
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Dec 16, 2009 9:23 am

Re: Warning message. How to correct ?

Postby dahaleuday » Sat Feb 13, 2010 8:00 am

i have same prob :pop

but thats sovled




thxxxxxxxxxxxxxxx :D :D :D :D :D

uneebe
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 07, 2010 5:13 am

Re: Warning message. How to correct ?

Postby uneebe » Wed Jul 07, 2010 5:34 am

hey all,
This problem starts when you save the "Global Configuration" for the first time.

There are several solutions for this..

1
"In the backend----> Configuration ----->System
On the right side there are settings for the cache.
In Port: I have put the value 0"
Thankx Viggo1.. this solution is superb


2 goto your joomla site folder. there you'll find the file "configuration.php" open it and goto the line similar to this

Code: Select all

var $cache_handler = 'memcache';

(its on line 25 in my file.) Replace this line with

Code: Select all

var $cache_handler = 'file';

and then find the line

Code: Select all

var $memcache_settings = array("persistent" => "0", "compression" => "0", "servers" => array("0" => array("host" => "", "port" => "")));
and replace it with

Code: Select all

var $memcache_settings = array();
(its line 26 in my file)

save the file and its done.

I Prefer the first solution..

Regards

User avatar
RustyJoomla
Joomla! Explorer
Joomla! Explorer
Posts: 390
Joined: Wed Aug 01, 2007 12:08 am
Location: UK

Re: Warning message. How to correct ?

Postby RustyJoomla » Fri Jan 28, 2011 4:19 pm

Thanks for the great post and the solution! Saved me some time!!
Follow me on Twitter - http://twitter.com/RustyJoomla

peter_ash
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Mar 02, 2011 9:54 pm

Re: Warning message. How to correct ?

Postby peter_ash » Wed Mar 02, 2011 9:56 pm

Hi everyone. Uneebe's second solution worked for me.

2 goto your joomla site folder. there you'll find the file "configuration.php" open it and goto the line similar to this
Code:
var $cache_handler = 'memcache';

(its on line 25 in my file.) Replace this line with
Code:
var $cache_handler = 'file';

and then find the line
Code:
var $memcache_settings = array("persistent" => "0", "compression" => "0", "servers" => array("0" => array("host" => "", "port" => "")));
and replace it with
Code:
var $memcache_settings = array();
(its line 26 in my file)

save the file and its done.



However, I'm just wondering and trying to understand why it worked so that if anything like this in the future happens I'll know what to look for... Thanks for your help!

-peter


Return to “General Questions/New to Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 12 guests