0

Recoverable fatal error: Object of class WP_Error could not be converted to string in H:\xampp\htdocs\edventus\wp-includes\default-constants.php on line 252

2
  • Have you recently put anything in wp-config.php? Commented Nov 3, 2018 at 7:02
  • no i did not add in this file
    – Ajeet Ws
    Commented Nov 3, 2018 at 9:33

1 Answer 1

0

What version of WordPress are you running? Can you perhaps include the code from line 252 of that file? If it's a current installation of WordPress, then it's this:

/**
 * @since 1.2.0
 */
if ( !defined('COOKIEPATH') )
  define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );

... And I can't really see why that all of a sudden should fail. ... So perhaps try and activate another theme, to see if it's some buggy code in your current theme - or if it's a corrupt WordPress installation.

In order to debug it, then you could (TEMPORARILY!!) change it to this, and reload a page and see what it outputs:

/**
 * @since 1.2.0
 */
if ( !defined('COOKIEPATH') ){
  echo '<pre>';
  print_r( get_option('home') );
  echo '</pre>';
  die();
  define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
}

If you have access to the database, then you could also see in wp_options-table, what the value for option_name=home is. Maybe something or someone changed the home-name to something mysterical.

... Or since it's a local installation, then it could be because of a space in the folder-name (in case that you changed the path for security's sake)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.