Getting the following error in my error log after upgrading to 8.1.
2024/04/02 20:36:22 [error] 27135#27135: *83883 FastCGI sent in stderr: “PHP message: PHP Warning: Constant WP_CRON_LOCK_TIMEOUT already defined in /xxxx/public/wp-config.php on line 91PHP message: PHP Warning: Constant AUTOSAVE_INTERVAL already defined in xxxxx/public/wp-config.php on line 92PHP message: PHP Warning: Constant WP_POST_REVISIONS already defined in /xxxxxx/public/wp-config.php on line 93PHP message: PHP Warning: Constant EMPTY_TRASH_DAYS already defined in /xxxxxx/public/wp-config.php on line 94”, client: xxxxxx, server: xxxxxxx, request: “GET / HTTP/2.0”, host: “xxxxx”
Looked for FastCGI plugin and none present. There must be another plugin using it that causing this?
I would like to welcome you to the Kinsta Community!
If you need to find files where the WordPress constants can be found, you can use the grep command via SSH. For instance, if you need to locate “WP_CRON_LOCK_TIMEOUT”, you can run the command grep -rl "WP_CRON_LOCK_TIMEOUT" ~/public. By running the grep command, you can search for entries containing “WP_CRON_LOCK_TIMEOUT” recursively from the ~/public folder.
The error in question (Constant already defined) indicates that the entries in your wp-config.php file have duplicate entries that are being loaded elsewhere. This can be an issue if your application (WordPress) is expecting one value for one of those entries, and it’s being overwritten by the variable being specified somewhere other than where you set the value originally.
You can remove or comment out those entries from wp-config.php to stop the errors if you don’t need those variables defined there.
Otherwise, you would want to remove or edit the secondary locations where those variables are being specified, to eliminate the duplication.
However by itself this error this error is not fatal to the site operation, so you can ignore it if you would like.
2024/04/17 01:14:02 [error] 121249#121249: *289836 FastCGI sent in stderr: "PHP message: PHP Warning: Constant WP_CRON_LOCK_TIMEOUT already defined in /www/mailhippo_201/public/wp-config.php on line 97PHP message: PHP Warning: Constant AUTOSAVE_INTERVAL already defined in /www/mailhippo_201/public/wp-config.php on line 98PHP message: PHP Warning: Constant WP_POST_REVISIONS already defined in /www/mailhippo_201/public/wp-config.php on line 99PHP message: PHP Warning: Constant EMPTY_TRASH_DAYS already defined in /www/mailhippo_201/public/wp-config.php on line 100" while reading response header from upstream, client: 174.163.22.49, server: www.mailhippo.com, request: "POST /wp-admin/admin-ajax.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php8.1-fpm-mailhippo.sock:", host: "www.mailhippo.com:48033", referrer: "https://www.mailhippo.com/wp-admin/plugins.php?plugin_status=all&paged=1&s"
It appears that the problem you’re experiencing may be related to cached data. I recommend clearing the cache in MyKinsta > Your site > Server cache (clear cache). This is because your staging site has the same custom configuration in its wp-config.php file but is not displaying any PHP warnings.
I was able to take a look at the site itself; currently the wp-config.php file has a set of constants, including WP_CRON_LOCK_TIMEOUT, loading after this section:
/** 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');
Can you please move these lines before this line in wp-config.php?
/* That's all, stop editing! Happy blogging. */
Then clear caches for the site. I believe that should resolve these errors you’re receiving.