Warning: Use of undefined constant WPE_CLUSTER_ID - assumed 'WPE_CLUSTER_ID'

I just setup my hosted WP Engine on Local. Got the local site running in the browser except I’m getting a warning. I don’t get this warning on the hosted site.

Warning: Use of undefined constant WPE_CLUSTER_ID - assumed 'WPE_CLUSTER_ID' (this will throw an Error in a future version of PHP) in /Users/paulna/Sites/cphfaithcourses/app/public/wp-content/mu-plugins/wpengine-common/plugin.php on line  *14*
Call Stack

Time Memory Function Location
1 0.0001 411376 {main}( ) .../index.php **:** 0
2 0.0001 411656 require( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-blog-header.php' ) .../index.php **:** 17
3 0.0001 412200 require_once( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-load.php' ) .../wp-blog-header.php **:** 13
4 0.0002 412720 require_once( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-config.php' ) .../wp-load.php **:** 37
5 0.0002 417400 require_once( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-settings.php' ) .../wp-config.php **:** 77
6 0.0084 2435088 include_once( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-content/mu-plugins/mu-plugin.php' ) .../wp-settings.php **:** 291
7 0.0086 2446232 require_once( '/Users/paulna/Sites/cphfaithcourses/app/public/wp-content/mu-plugins/wpengine-common/plugin.php' ) .../mu-plugin.php **:** 18

Any idea how I can resolve this?

1 Like

Hi @n8paul,

Thanks for the stack trace!

Was this site imported or pulled using Connect to WP Engine?

As far as a solution goes, if you add the following to your wp-config.php file before /* That's all, stop editing! Happy publishing. */, it should resolve the warning:

define( 'WPE_CLUSTER_ID', '0' );
1 Like

Hi @clay,

I’ve installed 5.2.1+2165 and pulled down the site I’m working on using Connect to WP Engine. I got exactly the same error. Should we be reporting this to WP Engine? Or is reporting here enough to get this issue looked at?

If we add this declaration to wp-config.php will this change be pushed to the live server when we use Push to WP Engine?

Many thanks!


You’re in the right place! We’re going to be looking into this in our next sprint (within 2 weeks or so).

Nope! wp-config.php is excluded when pushing.

1 Like

Hey @clay

The site was pulled using Content to WP Engine. And good news - your solution worked.

Thanks for the help!


Experiencing a similar issue. The suggested fix for updating wp-config didn’t resolve the problem. Any other thoughts?

Warning: Use of undefined constant PWP_NAME - assumed ‘PWP_NAME’ (this will throw an Error in a future version of PHP) in C:\Users\redacted\Local Sites\redacted\app\public\wp-content\mu-plugins\wpengine-common\wpe-sec.php on line 63

Call Stack

Time Memory Function Location

1 0.0002 393904 {main}( ) …\index.php : 0
2 0.0005 394104 require( ‘C:\Users\redacted\Local Sites\redacted\app\public\wp-blog-header.php’ ) …\index.php : 17
3 0.0006 394424 require_once( ‘C:\Users\redacted\Local Sites\redacted\app\public\wp-load.php’ ) …\wp-blog-header.php : 13
4 0.0007 394792 require_once( ‘C:\Users\redacted\Local Sites\redacted\app\public\wp-config.php’ ) …\wp-load.php : 37
5 0.0008 397128 require_once( ‘C:\Users\redacted\Local Sites\redacted\app\public\wp-settings.php’ ) …\wp-config.php : 77
6 0.0649 1835920 do_action( ) …\wp-settings.php : 523
7 0.0649 1836192 WP_Hook->do_action( ) …\plugin.php : 478
8 0.0649 1836192 WP_Hook->apply_filters( ) …\class-wp-hook.php : 312
9 0.0857 2040000 wpesec_encourage_tls( ) …\class-wp-hook.php : 288

I have the exactly same issue - any ideas how to manage this as it seems related to WPE

1 Like

Same issue it looks like. The solution doesn’t work for me either.

These general PHP errors are due to the wp-config.php is auto generated to work with the settings of Local.

There are two general solutions for this:

  1. Add the necessary PHP constants to get things to work. (not really recommended)
  2. Remove the WP Engine specific mu-plugins (contained within wp-content/mu-plugins, recommended!)

Since the mu-plugins are specific to the WP Engine platform, they aren’t needed within Local, and as you can see, they do generate PHP errors.

Can you try removing those files from any backup and then re-zip and import into Local?

OK, but if those are removed and then content is pushed back to the WPE would everything work properly?

Hey @GRSM78

Local has those files excluded from the push, so they won’t be pushed, nor will they be removed remotely.

Yes, when /mu-plugins/ has been removed the errors are gone and all is being displayed properly.

Considering you are now so close with WPE, is there a way not to pull them from the server at all or find some other solution that would not include manual intervention with each and single site?

Got the same error, and the above fixed it.

Also go this one, which it did not:

Followed advice above an removed the mu-plugins directory an it went away.

Deleting the /mu-plugins/ directory and adding define( 'WPE_CLUSTER_ID', '0' ); to the wp-config.php file did not work for me.

Has anyone else experienced this, is there a fix? This is my first time pulling from WPE using the new Local. Looks really sweet up until this issue!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.