admin管理员组文章数量:1415684
I made a local clone of a website that's running LIVE in order to safely work offline for a while. On every page of the local version I get a HUGE warning which says
Notice: Constant WP_POST_REVISIONS already defined in C:\xampp\htdocs\local-tutorials\wp-config.php on line 95
I guess it's been defined twice, once in wp-config.php
and once elsewhere, right? However, I've no clue where it's been defined for the second time.
I searched wp-config.php
for a second instance but no luck. I then checked the functions.php
in my theme but it doesn't contain any statement on revisions.
Googling leads mainly to rather old threads that seem to address a different issue.
I believe the error is related to a reasonably recent (< 1 year?) Wordpress update since it didn't occur previously but I'm not 100% sure on that.
Thank you in advance for any suggestions.
UPDATE
After searching all files, three contained wp_post_revisions
:
- C:\xampp\htdocs\local-tutorials\wp-config.php
- C:\xampp\htdocs\local-tutorials\wp-includes\default-constants.php
- C:\xampp\htdocs\local-tutorials\wp-includes\revision.php
I commented out the wp_post_revisions
in default-constants.php
and this seems to solve the problem. I find that a bit awkward since wp-config.php
is (partly) meant to override default constants.
So I think it's strange I get this huge error when I do so. Or am I missing something?
I made a local clone of a website that's running LIVE in order to safely work offline for a while. On every page of the local version I get a HUGE warning which says
Notice: Constant WP_POST_REVISIONS already defined in C:\xampp\htdocs\local-tutorials\wp-config.php on line 95
I guess it's been defined twice, once in wp-config.php
and once elsewhere, right? However, I've no clue where it's been defined for the second time.
I searched wp-config.php
for a second instance but no luck. I then checked the functions.php
in my theme but it doesn't contain any statement on revisions.
Googling leads mainly to rather old threads that seem to address a different issue.
I believe the error is related to a reasonably recent (< 1 year?) Wordpress update since it didn't occur previously but I'm not 100% sure on that.
Thank you in advance for any suggestions.
UPDATE
After searching all files, three contained wp_post_revisions
:
- C:\xampp\htdocs\local-tutorials\wp-config.php
- C:\xampp\htdocs\local-tutorials\wp-includes\default-constants.php
- C:\xampp\htdocs\local-tutorials\wp-includes\revision.php
I commented out the wp_post_revisions
in default-constants.php
and this seems to solve the problem. I find that a bit awkward since wp-config.php
is (partly) meant to override default constants.
So I think it's strange I get this huge error when I do so. Or am I missing something?
Share Improve this question edited Aug 16, 2014 at 7:13 RubenGeert asked Aug 16, 2014 at 5:56 RubenGeertRubenGeert 3972 gold badges3 silver badges11 bronze badges 2 |2 Answers
Reset to default 7I have the same problem before.
I put WP_POST_REVISIONS
in the end of wp-config.php
file and it didn't work correctly.
You should put your codes before defining ABSPATH
and before this line:
/* That's all, stop editing! Happy blogging. */
it must be something like in the following:
define( 'WP_POST_REVISIONS', 6 );
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
I hope it solves your problem.
So don't put your codes in the end of wp-config.php
file
I have experience of same error like that:
Notice: Constant WP_POST_REVISIONS already defined in var/www/html/wp-config.php on
line 95
And accordance code on line 95 is like following:
define( 'SCRIPT_DEBUG', true );
I make this 'false' and then move to line 86 above that commit:
/* That's all, stop editing! Happy blogging. */
And then it works. Hope your luck~
本文标签: errorsNotice Constant WPPOSTREVISIONS already defined
版权声明:本文标题:errors - Notice: Constant WP_POST_REVISIONS already defined 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745239578a2649243.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
define( 'WP_POST_REVISIONS', ...
line is beforerequire_once(ABSPATH . 'wp-settings.php');
– shea Commented Aug 21, 2014 at 11:49