PHP 8.1 & 2.0.19 should be OK, but I'm getting an error

Started by Rob Lightbody, October 11, 2024, 11:36:01 AM

Previous topic - Next topic

Rob Lightbody

If I understand correctly, the last version of PHP that 2.0.19 will support, is 8.1?

Using that, I get the following error (that I don't get on PHP 7.4).

8192: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Any advice appreciated please!

(Load.PHP attached - line 169)

vbgamer45

It actually supports up to 8.0 php you will get some warnings on 8.1
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Doug Heffernan

Also, do you have any custom mods installed? It might be that one of them isn't compatible with php 8.1.

Rob Lightbody

Quote from: Doug Heffernan on October 11, 2024, 11:42:29 AMAlso, do you have any custom mods installed? It might be that one of them isn't compatible with php 8.1.
Thanks - yes I do - how would I know which one might be the culprit?

Doug Heffernan

Quote from: Rob Lightbody on October 11, 2024, 11:51:00 AMThanks - yes I do - how would I know which one might be the culprit?

If their developer isn't active to answer support questions on their support topics, the best way to go about it imo is to uninstall them one by one and check after each uninstallation.

Rob Lightbody

Quote from: vbgamer45 on October 11, 2024, 11:39:41 AMIt actually supports up to 8.0 php you will get some warnings on 8.1

The funny thing is, if I set PHP to 8.0, the forum stops working altogether with the following error -
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/theqesto/public_html/forum/Sources/Subs-Db-mysql.php:70 Stack trace: #0 /home/theqesto/public_html/forum/Sources/Load.php(1994): smf_db_initiate() #1 /home/theqesto/public_html/forum/index.php(72): loadDatabase() #2 {main} thrown in /home/theqesto/public_html/forum/Sources/Subs-Db-mysql.php on line 70
But setting it to 8.1, 8.2 or 8.3 seems to work fine, except for the error noted in my first post which appears in the errors log.

vbgamer45

Strange it shouldn't pickup the old mysql code should try the mysqli version. I would check that the 8.1 version has mysqli support built in.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

I would post the full error message with file and line number for the original error as well.
I made a few tweaks on 2.0.19 to get it to work for 8.1 to remove those errors.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Doug Heffernan

Indeed. mysql_connect() has been deprecated since PHP 5.5.0.

Rob Lightbody

Quote from: vbgamer45 on October 11, 2024, 11:56:22 AMI would post the full error message with file and line number for the original error as well.
I made a few tweaks on 2.0.19 to get it to work for 8.1 to remove those errors.

Thanks - I've attached the load.php file to the original post as suggested.

vbgamer45

I saw that but do you have the full error log message file and line number? or screenshot. Since the first post doesn't have detail. 8192 isn't a line in load.php
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Rob Lightbody

Quote from: vbgamer45 on October 11, 2024, 12:13:44 PMI saw that but do you have the full error log message file and line number? or screenshot. Since the first post doesn't have detail. 8192 isn't a line in load.php

I've now added the line number (169)
not sure what you mean by the error log message file... !

vbgamer45

Attached updated file.
Looks like your editor did some changes to the file since differs in coding style from the default smf 2.0.19 file.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Rob Lightbody

Quote from: vbgamer45 on October 11, 2024, 12:54:50 PMAttached updated file.
Looks like your editor did some changes to the file since differs in coding style from the default smf 2.0.19 file.

Thank you, that worked!  It seems that the editor thats built into cpanel's file manager is causing the problems.  I'll stick to Notepad++ from now on.

Doug Heffernan

Quote from: Rob Lightbody on October 12, 2024, 11:12:55 AMI'll stick to Notepad++ from now on.

A word of advice, if I may, whenever you are working on a file, no matter what editor you use, it's always best to make first a backup of said file beforehand. Notepad++ has a built in feature for that, called Auto Backup. It can be found at Settings->Preferences->Backup.

Like that, no matter what happens, you can always roll the file back to the state it was before it was changed.

Advertisement: