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~
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745239578a4618097.html
define( 'WP_POST_REVISIONS', ...
line is beforerequire_once(ABSPATH . 'wp-settings.php');
– shea Commented Aug 21, 2014 at 11:49