Roundcube Community Forum

 

Error 500 after login

Started by ricodahalvarez, July 10, 2017, 12:08:25 PM

Previous topic - Next topic

ricodahalvarez

Hi all
I can't resolve an internal error from my nginx server (Debian 8 ). As soon as I try to connect to the webmail, I get a 500 error.
Looking in the logs, I see this:

me@myserver:~# tail -f /var/www/roundcubemail/logs/error.log
PHP message: PHP   5. rcube_config->load() /var/www/roundcubemail/htdocs/program/lib/Roundcube/rcube_config.php:87
PHP message: PHP   6. rcube_config->load_from_file() /var/www/roundcubemail/htdocs/program/lib/Roundcube/rcube_config.php:207" while reading response header from upstream, client: 82.66.30.55, server: webmail.*, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "webmail.creationsitewebpro.com"
2017/07/10 16:38:57 [error] 34609#0: *104 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected '$config' (T_VARIABLE) in /var/www/roundcubemail/htdocs/config/config.inc.php on line 54
PHP message: PHP Stack trace:
PHP message: PHP   1. {main}() /var/www/roundcubemail/htdocs/index.php:0
PHP message: PHP   2. rcmail::get_instance() /var/www/roundcubemail/htdocs/index.php:43
PHP message: PHP   3. rcube->__construct() /var/www/roundcubemail/htdocs/program/include/rcmail.php:75
PHP message: PHP   4. rcube_config->__construct() /var/www/roundcubemail/htdocs/program/lib/Roundcube/rcube.php:148
PHP message: PHP   5. rcube_config->load() /var/www/roundcubemail/htdocs/program/lib/Roundcube/rcube_config.php:87
PHP message: PHP   6. rcube_config->load_from_file() /var/www/roundcubemail/htdocs/program/lib/Roundcube/rcube_config.php:207" while reading response header from upstream, client: 82.66.30.55, server: webmail.*, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "webmail.creationsitewebpro.com"


The error seems to concern the SMTP configuration (line 54 is $config['smtp_server'] = '';) ...

Here is the content my config.inc.php to help the debug:
$config = array();

// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql or sqlsrv
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path: 'sqlite:////full/path/to/sqlite.db?mode=0646'
$config['db_dsnw'] = 'mysql://roundcube:aXglUumq@localhost/roundcubemail';

// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'localhost';
$config['imap_cache'] = memcache;
//$config['messages_cache'] = db


// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = '';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 25;
//$config['smtp_port'] = 587;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';

// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';

// List of active plugins (in plugins/ directory)
$config['plugins'] =  array(
    'sieverules',
    'archive',
    'zipdownload',
);
// skin name: folder from skins/
$config['skin'] = 'larry';
$config['sieverules_port']=4190;


Would anyone have any idea to solve this problem?

Best regards,
Rico da Halvarez

JohnDoh

this line:

$config['imap_cache'] = memcache;

should be:

$config['imap_cache'] = 'memcache';
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

ricodahalvarez

Hi,
Thanks for your reply, the syntax was indeed bad. But the problem persists, it is always the same line of config.inc.php which is designated:
$config['smtp_server'] = '';

Another idea?

Best regards,
Rico

JohnDoh

check the rest of your config files for syntax errors, especially the lines before $config['smtp_server'] = '';
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

ricodahalvarez

Hi,
I carefully looked at the file config.inc.php, nothing seems suspicious except what you had noticed. Any other leads?
Best regards,
Rico

JohnDoh

perhaps try putting the config back to defaults and adding in your config line by line until you find the problem
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...