Website getting http error 500

(https://tourkasaragod.in/)

I’m getting http error 500

Fatal error : Uncaught Error: Call to undefined function str_contains() in /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-includes/default-constants.php:121 Stack trace: #0 /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-settings.php(61): wp_initial_constants() #1 /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-config.php(82): require_once(‘/home/vol1000_8…’) #2 /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-load.php(50): require_once(‘/home/vol1000_8…’) #3 /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-blog-header.php(13): require_once(‘/home/vol1000_8…’) #4 /home/vol1000_8/epizy.com/epiz_34156675/htdocs/index.php(17): require(‘/home/vol1000_8…’) #5 {main} thrown in /home/vol1000_8/epizy.com/epiz_34156675/htdocs/wp-includes/default-constants.php on line 121

the website was working fine today. And when I tried to check the website it is getting http 500 error. I’ve done Alter PHP Config and got this.

Hi and welcome to the forum! Seems like the WordPress developers added a breaking change on WordPress 6.3, since str_contains() is a PHP 8 function. I suggest to not update to WordPress 6.3 until the new PHP 8.1 rollout will complete, and instead keep WordPress 6.2.2 for now, but since you updated you’ll have to roll back.

3 Likes

I checked the WordPress source code, and this issue shouldn’t be happening.

Yes, str_contains is a PHP 8 function. But WordPress includes some code so it creates it’s own version of str_contains if it’s not provided by PHP, to ensure compatibility with older PHP versions.

If that’s not loaded, I suspect that there may be some code corruption in your WordPress installation. So you may want to try if this fixes it:

6 Likes

Hi there,
Thanks. It worked.

I’ve one more query. I’m getting this in my admin dashboard - “An automated WordPress update has failed to complete - [please attempt the update again now]”.
Is this the 6.3 update? When will the 6.3 update available for use?

Probably

It is not recommended to update directly in your wp-admin. You should open Softaculous to see if there’s an update available, or manually uploading the WordPress 6.3 to your website.

3 Likes

I have got Wordpress 6.3 update available now in Softaculous. So I can update from there, right? Will this error occur again after updating in Softaculous?

Yes

Not if you do this

3 Likes

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