• Resolved Mike Witt

    (@mike80222)


    I just switched from PHP 7.4 to PHP 8.1 and I noticed that in Site Health under WordPress Constants, both WP_HOME and WP_SITEURL show as Undefined. Shortcodes that use site url still appear to be working, so it doesn’t appear that anything is actually undefined. But I would like to know if this is a generic issue with Site Health and PHP 8.1, or if it could be a sign of something configured wrong on my site. And if so, how might I go about looking for what’s wrong.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I don’t think this has anything to do with moving from PHP 7.4 to 8.1. I just whipped up a sandbox 6.2.2 site with PHP 7.4, the default theme and no plugin, and I see the same as you’re “Undefined” as you’re seeing.

    I believe that portion of the report refers to WordPress’s PHP constants, commonly defined in wp-config.php file.

    So what you’re seeing should be normal if you don’t have these constants defined in your wp-config.php file… and you don’t need to define these constants unless you want to override your site’s URLs stored in the database.

    Thread Starter Mike Witt

    (@mike80222)

    @gappiah, thanks so much. I do believe you’re right. I was confused about what happened. But when I try it on a test site, I see the same thing as you. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site Health and PHP 8.1’ is closed to new replies.