• Resolved thatsinsurance

    (@thatsinsurance)


    Hi

    I have this plugin on my other websites with no issues, its brilliant! However, I set up a staging site for testing purposes and I cannot activate it on there.

    I get this error:-

    Fatal error: Cannot declare class QM_PHP, because the name is already in use in /home/pinkcom/public_html/demo/wp-content/plugins/query-monitor/classes/PHP.php on line 8

    I have done a search on the entire query monitor folder on my localhost, there is only one class of QM_PHP

    I am running on PHP 7.4 and WordPress 5.9.
    I disabled all other plugins that didnt work
    I tried deleting the plugin and re-downloading
    I tried cleaning my database for any transients that might cause issue
    I searched my entire current local site for instances of QM_PHP and the only instances found were in the query-monitor plugin.

    EDIT: Even though the plugin is not supposedly activated, I am seeing on debug the following query.

    SELECT option_name, option_value FROM wp_options WHERE autoload = ‘yes’
    require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), wp_not_installed, is_blog_installed, wp_load_alloptions, QM_DB->query

    It seems that db.php was loaded as a drop in on my plugins and is activated, even though the plugin isnt.
    Has anyone come across this before and if so, how did you solve it? Any help appreciated.

Viewing 1 replies (of 1 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    It sounds like you had a db.php file left over or copied from somewhere else. Usually this shouldn’t cause a problem if the Query Monitor plugin isn’t active or isn’t present, but in the past I’ve seen a stale opcode cache cause a similar problem. This isn’t specific to QM, but I think it’s an issue with symlinks.

    Try deleting the db.php symlink. QM will try to recreate it if necessary.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot Activate Query Monitor PHP Error Cannot Redeclare QM_PHP’ is closed to new replies.