Website is down and shows HTTP Error 500

Hello!

We have this website, and it’s currently down - showing HTTP Error 500 on the page.

The site is in Wordpress, and is hosted via GoDaddy. I tried reaching support, and this is what they told me:

I have cross checked with my resource team and noticed that when we opened the site it shows the “HTTP ERROR 500” that means your index file is corrupted.
We recommend you to please do check with your developer and review the content.

I am the dev, and I have no idea what’s going on. I do front-end, so I’m not very familiar with issues like this.

I checked web server error logs, and this is what I found:

[Mon Feb 27 12:23:38.783879 2023] [lsapi:error] [pid 1717599:tid 140032647993088] [remote 158.62.90.201:4477] [host kalesamag.com] Backend fatal error: PHP Parse error: syntax error, unexpected 'true' (T_STRING), expecting variable (T_VARIABLE) in /home/kalesamag/public_html/wp-includes/functions.php on line 816\n

This is line 816, and thought this has to be the culprit. I tried deleting, but it didn’t fix that. Can somebody point me to the right direction?

That line of <0x00> is so long, the file shrunk to 90KB from 229KB when line was deleted.
Below are lines 816-826 after <0x00> was deleted.

function do_enclose( $content = null,*MANY <0x00>*rn true;
	}

	if ( ! $site_id ) {
		$site_id = get_current_blog_id();
	}

	$site_id = (int) $site_id;

	return $site_id === get_main_site_id( $network_id );
}

Would appreciate any help, thank you!

Do you have a backup of that file? If so, just overwrite it with the backup and see if your website comes back up. Looks like perhaps it was overwritten by some malicious script.

Restore the file, see if the site comes back up, then do a full audit of the site and see what pages changed, check any logs you have to see if something was uploaded and look for files that look suspicious. Maybe even install a security plugin like wordfence and run a scan.

Hello, thanks for the suggestion. Unfortunately, restoring an earlier version of the file didn’t work and only caused some other error as shown in the logs. The malware scan returned nothing too.

We didn’t really have the time to dig through it, and none of us was knowledgeable enough with issues like this so we ended up reinstalling Wordpress which resolved it. Good thing there were no problems with the database so I was able to at least retrieve most website content.

Thanks again!

1 Like

What version of WordPress are you using?

The current version of functions.php on Github shows a very different structure, both in line numbers and function parameter construction ($content no longer has a default value, for example)