Support » Plugin: Cache Enabler » Set WP_CACHE does not find wp-config.php in some cases

  • Resolved Ov3rfly

    (@ov3rfly)


    When debugging an issue with WP_CACHE being not set by plugin, found that plugin looks in WordPress root but not one level above as WordPress itself does.

    Plugin checks this path:

    $wp_config_file = ABSPATH . 'wp-config.php';
    

    WordPress checks the same path

    if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
    

    and if not found WordPress checks another path:

    } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ...
    

    That mechanism is present in WordPress for security reasons to be able to place wp-config.php outside htdocs folder.

    Suggestion: Look for wp-config.php in same way as WordPress does.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set WP_CACHE does not find wp-config.php in some cases’ is closed to new replies.