Roundcube cleandb failing, what's the right fix?

Problem Description

/usr/share/roundcube/bin/cleandb.sh is failing with

PHP Warning: strlen() expects parameter 1 to be string, array given in /etc/roundcube/config.sympl.inc.php on line 21

The offending code is:

 * Set the default server host, if not already set.
 */
if ( !array_key_exists('default_host', $config) or
     strlen($config['default_host']) == 0 ) {

  $config['default_host'] = 'localhost';

}

I also see that config.inc.php says
$config['default_host'] = array("localhost:143");

so is the right fix to change config.sympl.inc.php to change the text

    if ( array_key_exists('default_host', $config) or
            !empty($config['default_host'])  {

or should the definition in config.inc.php be altered to just a string? This may be my settings, I think I had to install roundcube ‘by hand’ because back in the mists of time it didn’t install properly.

Environment

  • Sympl Version 10.0:
  • Sympl Testing Version? No
  • Debian Version Buster:
  • Hardware Type? Virtual
  • Hosted On? Mythic Beasts
1 Like

A warning isn’t the same as a failure (from PHP’s point of view).

I suspect the code has always been wrong, and was doing a ‘strlen’ on the string ‘Array’ originally.

Just a newer version of PHP has highlighted this as a potential problem.

To fix … either you continue ignoring it, or change the default host / config to be :

$config[‘default_host’] = ‘localhost:143’;

(I’ve no idea what roundcube actually expects there to be in config[‘default_host’] )

1 Like

Having poked about a bit, I suspect that the value should be ‘localhost’ - and that seems to be the case in another Sympl installation I’ve looked at. So this is a non-problem for most people.

Thanks for the response, it prompled me to look about a bit more.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.