• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

Resolved Wordpress Toolkit claiming database access issue where there is none

Bitpalast

Plesk addicted!
Plesk Guru
When scanning for new Wordpress installations that were done manually we are seeing:

Subscription "<domain>": Error establishing a database connection. This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `localhost:3306`. This could mean your host’s database server is down.

However, the database is online, the website is working, it is a very normal Wordpress installation with no extra security gimmicks and the database access credentials are correct.

How to trouble shoot?

P.S. latest toolkit version on Plesk Onyx 17.5., MU #10
 
Hi Peter,

This behavior is similar to the fact that scan finds a single orphaned wp-config, tries to parse it and connects to the database. If you enable debug mode and check panel.log you can find this config. Like in this example:


[2017-06-26 16:21:06] DEBUG [util_exec] [fd4404b498a5bbef451f6a71178d426b-0] Starting: filemng user_bedwcibobh exec /var/www/vhosts/domain220xv89.w10-52-54-168.qa.sdf.ru /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/bin/wp --path=/var/www/vhosts/domain220xv89.w10-52-54-168.qa.sdf.ru/uzfyaq/wp_vrdes user check-password ******
[2017-06-26 16:21:07] DEBUG [util_exec] [fd4404b498a5bbef451f6a71178d426b-0] Finished in 1.51065s, Error code: 1
 
Hello,

When scaning subscription we used the following algorithm:

- Find both wp-includes and wp-content directories in some directory withing subscription.
- Find wp-config.php in the same directory or in the parent directory (priority has wp-confg.php at the same directory).

Path to the directory where located wp-includes and wp-content considered as WordPress instance base path. Then WordPress Toolkit retrieve instance details using WP-CLI utility.

The message like "This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `localhost:3306`. This could mean your host’s database server is down." issued by WordPress itself, so it looks like database access, specified in wp-config.php file at default location, really wrong. Probably, your WordPress customized to use wp-config.php at custom location?
 
I am definitely thankful for the ingenious analysis. You were right, debug logging revealed:

[2017-06-27 10:00:48] ERR [extension/wp-toolkit] Unable to check WordPress admin credentials while reset cache: Unable to read or execute files from the WordPress root directory.

The reason for the behavior was not wrong access credentials but file permissions of wp-config.php set to 600 instead of 640. The file must be group readible for WP toolkit to be able to read it. After I changed the file permission to 640, WP toolkit was able to detect the installation and added it to the management console.

Thank you very much for your help!
 
Back
Top