$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - This occurs when I open admin or front on localhost|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - This occurs when I open admin or front on localhost

matteradmin9PV0评论

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

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

Share Improve this question edited Nov 3, 2018 at 8:24 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 3, 2018 at 6:55 Ajeet WsAjeet Ws 11 bronze badge 2
  • Have you recently put anything in wp-config.php? – Jacob Peattie Commented Nov 3, 2018 at 7:02
  • no i did not add in this file – Ajeet Ws Commented Nov 3, 2018 at 9:33
Add a comment  | 

1 Answer 1

Reset to default 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)?

Post a comment

comment list (0)

  1. No comments so far