query-monitor
query-monitor copied to clipboard
PHP Fatal error: Cannot declare class QM_PHP, because the name is already in use
E_COMPILE_ERROR was caused in line 8 of the file [...path...]/wp-content/plugins/query-monitor/classes/PHP.php
I searched for this and found the same item closed 4 days ago. Uninstalled and reinstalled to see if that solved it - no. Per the other issue, I can confirm that the [...path...]/wp-content/db.php symlink is pointing correctly to [...path...]/wp-content/plugins/query-monitor/wp-content/db.php.
In my case, I do in fact utilize Wordpress Toolkit for cloning to subdomains and I noted the symlink clones referring back to original site. It would be wonderful if this was clone friendly, but that's not the end of things since generally I delete plugin within production; so not a normal flow. Have another site on same server I clone and Query Monitor is happily working. Versions are identical in both sites, though different plugin combinations.
For what it's worth, here's a grep of QM_PHP in that sites root (in case that helps identify something residual?):
grep -R QM_PHP ./* ./wp-content/db.php:if ( ! QM_PHP::version_met() ) { ./wp-content/plugins/query-monitor/query-monitor.php:if ( ! QM_PHP::version_met() ) { ./wp-content/plugins/query-monitor/query-monitor.php: add_action( 'admin_notices', 'QM_PHP::php_version_nope' ); ./wp-content/plugins/query-monitor/wp-content/db.php:if ( ! QM_PHP::version_met() ) { ./wp-content/plugins/query-monitor/classes/Activation.php: if ( ! QM_PHP::version_met() ) { ./wp-content/plugins/query-monitor/classes/Activation.php: QM_PHP::$minimum_version, ./wp-content/plugins/query-monitor/classes/PHP.php:abstract class QM_PHP {
I've got to the same issue... is there any solution to solve this?
Here's my grep-result:
$ grep -R QM_PHP ./*
./wp-content/plugins/query-monitor/classes/Activation.php: if ( ! QM_PHP::version_met() ) {
./wp-content/plugins/query-monitor/classes/Activation.php: QM_PHP::$minimum_version,
./wp-content/plugins/query-monitor/classes/PHP.php:class QM_PHP {
./wp-content/plugins/query-monitor/wp-content/db.php:if ( ! QM_PHP::version_met() ) {
./wp-content/plugins/query-monitor/query-monitor.php:if ( ! QM_PHP::version_met() ) {
./wp-content/plugins/query-monitor/query-monitor.php: add_action( 'admin_notices', 'QM_PHP::php_version_nope' );
./wp-content/db.php:if ( ! QM_PHP::version_met() ) {
Try to delete db.php
in your wp-content
dir, worked for me.
Try to delete
db.php
in yourwp-content
dir, worked for me. @jmslbam Didn't work for me.
Some issues may be solved by adjusting the symlink to use a relative path, instead of an absolute path.
See #247.
Thank you @jmslbam - worked :-)