Query Monitor Does Not Show Extended Information Without a Symlink:
The WordPress plugin Query Monitor, when being installed, tries to create a symlink
wp-content/db.php to the file
If the symlink could not be created, the plugin would not show the extended query information. And you’ll see the messages in the plugin panel:
Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its
db.php file into place. See this wiki page for more information.
In this case, it is recommended to create the symlink to db.php manually. But if you can not do this:
How to Show Extended Information Without a Symlink?
Create a file
db.php in the directory
wp-content of your WordPress site (the directory
wp-content is located in the webroot of your WordPress site). Add these lines to the file:
<?php include __DIR__ . '/plugins/query-monitor/wp-content/db.php';
Now, the extended query information will be shown in the plugin panel.
I tested with Query Monitor verion 3.15.0.
Why Not Just Create a Symlink to db.php, as Recommended?
Sometimes you can not create the symlink.
For example, if you work on a Windows computer. And, for web development, you run a Linux virtual machine on Oracle VirtualBox. And you have your WordPress site inside a Docker container. And you are using VirtualBox Guest Additions to share your local WordPress folder to this virtual machine. In this case, you would be unable to create the symlink. Even manually. Even under Linux root.
If you run the command in the WordPress webroot directory inside the Docker container:
ln -s ./wp-content/plugins/query-monitor/wp-content/db.php ./wp-content/db.php
, the operation will fail:
So sometimes you can not create a symbolic link. And you need a workaround.
Why Can Not I Just Copy the File db.php to the Directory wp-content?
If you copy the file
wp-content/plugins/query-monitor/wp-content/db.php to the directory
wp-content, you’ll see this message in the plugin panel:
Extended query information such as the component and affected rows is not available. A conflicting
db.php file is present. See this wiki page for more information.
So copying the file would not solve the problem.
Please see the plugin author’s explanation for why the file
wp-content/plugins/query-monitor/wp-content/db.php can not be simply copied to the directory
In short, this could overwrite
db.php created by some other plugin there. Such a plugin as:
- W3 Total Cache