Skip to content

Finding your website's configuration file

Most website software keeps its database details, site address and main settings in one configuration file. You’ll need it when you move a site, change a database password, or fix “Error establishing a database connection”.

All paths below start from your website’s folder, for example public_html for your main domain. In cPanel’s File Manager, click Settings and tick Show Hidden Files to see files that start with a dot, such as .env.

Software Configuration file Database settings
WordPress wp-config.php DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
Joomla configuration.php $db, $user, $password, $host
Laravel .env (in the project folder, not public) DB_DATABASE, DB_USERNAME, DB_PASSWORD, DB_HOST
PrestaShop 1.7 and newer app/config/parameters.php database_name, database_user, database_password, database_host
PrestaShop 1.6 config/settings.inc.php _DB_NAME_, _DB_USER_, _DB_PASSWD_, _DB_SERVER_
OpenCart config.php and admin/config.php DB_DATABASE, DB_USERNAME, DB_PASSWORD, DB_HOSTNAME
Drupal sites/default/settings.php $databases array
Magento 2 app/etc/env.php 'db' section
WHMCS configuration.php $db_name, $db_username, $db_password, $db_host
MyBB inc/config.php $config['database']
phpBB config.php $dbname, $dbuser, $dbpasswd, $dbhost

On Ruachost hosting, the database host is localhost, and database names and users start with your cPanel username, for example cpuser_wp123. See Finding your database details.

  1. In File Manager, right-click the file and choose Download to keep a copy.
  2. Right-click it again and choose Edit.
  3. Change only the values between the quotes, and keep the quotes, commas and semicolons.
  4. Click Save Changes, then reload your website.

If the site shows an error after saving, upload your saved copy to undo the change.

Was this page helpful?