Database connection errors happens when the followings happens:
- You don't have proper database info set up in the configuration file (config/db.inc.php)
- Your system don't have the requirements needed to run roundcube.
To solve the first problem, you need to configure the following parameter correctly
$rcmail_config['db_dsnw'] = '{db_provider}://{username}:{password}@{host}/{database}';
{db_provider} is database agent such as mysql,mysqli,sqlite etc
{username} is your username to the database
{password} is your password to the database
{host} is either localhost or some host parameter for the location of your database server
{database} is your database name, by default it is roundcubemail
ex $rcmail_config['db_dsnw'] = 'mysql://myuser:mypassword@localhost/roundcubemail';
To solve the second problem, you need to run the installer to verify your system. Please remove installer/ folder once you have done the installation.
To run the test
go to {roundcube_domain}/installer/index.php
And you will see all the requirements needed to run roundcube. Follow the instruction, you will be running roundcube in no time. Hope this helpful.