admin管理员组文章数量:1130349
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 2Recoverable 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
- 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
1 Answer
Reset to default 0What 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)?
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 2Recoverable 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
- 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
1 Answer
Reset to default 0What 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)?
本文标签: phpThis occurs when I open admin or front on localhost
版权声明:本文标题:php - This occurs when I open admin or front on localhost 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749209114a2333065.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论