News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

PHP 8+ breaks the site (v2.1.4)?

Started by KrisB, November 18, 2024, 07:21:26 AM

Previous topic - Next topic

KrisB

Hi Folks,
I run private forum for a few friends. It was running well with SMF version 2.0.19.
The host company then upgraded PHP to 8.2 which broke the site. I realised it was because I hadn't upgraded my SMF version in a while, fair enough. In the admin tools of my host I could put this back to PHP 7.2, which I did and got it back running.
I then upgraded the forum to 2.1.4, which went well, the site was working and had no errors.
But now putting the server back to PHP 8.2 still crashes the forum?
I get
"currently unable to handle this request.
HTTP ERROR 500
"
I can keep it working with PHP 7.2, but obviously that won't work forever ... Any suggestions as to where to go from here? I thought 2.1.4 worked with PHP 8+?
Thanks
Kris

Aleksi "Lex" Kilpinen

First thing I would look at, is your server error log. What exactly is the HTTP 500? What gets logged?
SMF 2.1.4 should be fine with PHP 8.2 (and 8.3) so most likely explanation is custom code, a modification perhaps?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

KrisB

Thank you for replying.

The php error log says:

[18-Nov-2024 13:22:03 UTC] PHP Parse error:  syntax error, unexpected integer "27" in /home/customer/www/[redacted]/public_html/forum/Settings.php on line 133

which is the database password?

The password does have special characters in it ... "#[}%".

KrisB

Yes, that was it. Thank you.

The special characters in the database password fouled up the creation of the settings file properly so that it caused the error. Why that was a problem in 8.2 but not 7.4 I don't know, but changing the password to one without special characters in it fixed it.

Aleksi "Lex" Kilpinen

That sounds odd, but good that you figured it out.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: