| Joomla

2 Reasons to access configuration.php in Joomla

Two reasons you might need to access configuration.php are:

  1. How to find your Database Credentials
  2. How to set Error Reporting to Maximum

We can help you with that.

How to Find your Database Credentials

At times, you may need to get into the database to resolve a problem and not know the username and password for the database. You can find the Database Name, Username, and Prefix in System -> Global Configuration. But what if you can’t get into the backend at all?

In order to use this method, you will need access to the site’s hosting or FTP. Below will show directions via cPanel.

  • Login to cPanel
  • Click on File Manager

cPanel File Manager

  • Click on public_html

There you’ll see the configuration.php file.

public_html

  • Click on configuration.php once
  • Click edit or view

configuration file

You’ll then see a warning telling you to take a backup of the file. That’s best practice, so do that. Then repeat the steps so that you can edit or view the file.

configuration file edit

In the image below, you’ll see the different entries in the file for the database credentials.

08 db name un pw

public $db = ' ' is the database name for the site's database

public $dbprefix = ' ' is the database prefix for the site's database

public $password = ' ' is the database password for the site's database

public $user = ' ' is the database user name for the site's database

With this information, you can now login to the phpMyAdmin portion of cPanel and get to the proper database. You will need access to the hosting account in order to use these credentials. If you do not have it, you'll have to request for someone to give you access or perhaps suggest a Zoom call, so that you can do it once they login.

Some hosts block phpMyAdmin for security purposes. If that is the case for you, you'll need to contact the host and ask that they enable it for you temporarily whilst you do what you need to do.


How to Change Error Reporting to Maximum when you can’t get to the Backend of Joomla

Things happen. They happen to all of us. Sometimes that thing is a white screen of death on the frontend of your site and the inability to get to the backend at all.

When this happens, it’s helpful to get more information so it gives us a direction to go. Joomla has a setting in Global Configuration to set Error Reporting to various levels. When we have a white screen of death, we need to set Error Reporting to Maximum. Since we don’t have access to the backend, we’ll show you how to change it via the configuration file.

  • Login to cPanel
  • Click on File Manager

cPanel File Manager

  • Click on public_html

Then you'll see the configuration.php file.

02 public html

  • Click on configuration.php once
  • Click Edit

04 configuration file edit

You’ll then see a warning telling you to take a backup of the file. That’s best practice so do that. Then repeat the steps so that you can edit the file.

05 config file edit

  • Scroll down until you see public $error_reporting
  • Change ‘default’ to ‘maximum

06 error reporting default

  • Click Save at the top.
  • Go to the frontend of your website 
  • Refresh the page

You may now see one or more errors across the top of your screen. By focusing on the latter parts of the error(s), it can clue you in to what extensions might be an issue.

From there, you can disable them via phpMyAdmin, so that you can gain access to the backend and/or have the frontend appear again.

See the blog post How to Disable Plugins from phpMyAdmin for more info.

Chck out all the great Joomla training that OSTraining offers!


About the author

Jenn has worked with Joomla since 2006 and for clients since 2010. She co-organised the JUG Bay Area for many years and volunteers for the Joomla! Project regularly. Originally from Santa Cruz, CA, she now lives near Austin, TX.