Problem after upgrading to BL5 & at same time, php8

A month ago I upgraded to BL5. Around the same time my host upgraded php to php 8.2. My site [www.PhotoLens.co.uk & Galleries.PhotoLens.co.uk] can still be accessed via ‘index.html’, but not ‘index.php’. The following message is shown:

“Creation of dynamic property PageController::$dbHandler is deprecated|#0 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-framework/controllers/Controller.php(45): ErrorHandler::handleError() #1 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-designer/application/controllers/PageController.php(14): Controller->loadDAO() #2 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-framework/models/Dispatchable.php(292): PageController->__construct() #3 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-framework/models/Dispatchable.php(215): Dispatchable->createControllerIfNeeded() #4 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-framework/models/Dispatchable.php(89): Dispatchable->processParameters() #5 /vhost/p/h/o/photolens.co.uk/www/backlight/modules/module-framework/Framework.php(50): Dispatchable->init() #6 /vhost/p/h/o/photolens.co.uk/www/index.php(38): Framework->route() #7 {main}|URL: /index.php”

I contacted my host, and their reply is:

"Thank you for contacting support services regarding website issues.
"On checking I can see that some of the coding used by the website has deprecated and will require updating.
"I would advise reviewing the website coding and updating the coding to work with the new PHP version 8.2.
"You may wish to downgrade the PHP version to the previous version while carrying out this upgrade.
"This can be actioned via the web hosting section of the control panel and will be available until the 9th January 2024 when the PHP version 8.2 will be permanent.
"Please allow 1-2 hours for any php version changes to be processed on the website before testing. "

I think that the site worked prior to the php upgrade, but Christmas has got in the way for a total memory recall, sorry. I am at a total loss!!

Dave

What version were you upgrading from?
If it’s BL2 or later, did you do anything other than going to the Backlight Modules page and clicking on the Update link?
Have you tried reverting to an earlier version of php?

My host is also running php 8.2 and my sites are running just fine, so it may be a host configuration issue or there’s something else going on.

I see that trying to access the Backlight login screen results in a similar error.

It’s likely that @Ben will need to dive into this. He’ll likely need Backlight admin credentials along with FTP credentials.

Hi @DaveC, it looks like your site hasn’t yet been upgraded to BL5 or the latest version of BL5.

Can you try visiting Backlight 3 Installer and running the installer again?
The installer is titled ‘Backlight 3’ but will update the Backlight files with the version you have purchased. Running this will keep your settings and data intact.

If you receive a similar error on the installer, then can you try using the latest installer you received with your Backlight 5 purchase? To do so, only replace the directory backlight/installer and nothing else, including leaving the rest of the backlight folder as-is.

Thanks to both Rod & Ben.

Rod - upgrading from BL3 and followed the update link. php 8.2 is now permanent and can’t be reversed.

Ben - I’ve replaced backlight/installer, given the order number and e-mail address [I’ve even tried 2 other e-mail addresses] and the following message is shown:

“Fatal error: Uncaught ArgumentCountError: preg_match() expects at least 2 arguments, 1 given in /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php:136 Stack trace: #0 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(136): preg_match() #1 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(89): Client->pageURL() #2 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(28): Client->post() #3 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Installer.php(177): Client->hasBacklight() #4 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Installer.php(29): Installer->attemptLogin() #5 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/index.php(18): Installer->process() #6 {main} thrown in /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php on line 136”

[www.PhotoLens.co.uk is the main domain of which Galleries.PhotoLens.co.uk is a sub-domain.]

Hi Dave, I’m not sure why the installer is using that particular file. I found found a minor issue in it and pushed an update. Can you try reinstalling Backlight again by visiting backlight/installer/ on your site?

Ben

Looks like the same message:

Fatal error: Uncaught ArgumentCountError: preg_match() expects at least 2 arguments, 1 given in /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php:136 Stack trace: #0 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(136): preg_match() #1 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(89): Client->pageURL() #2 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php(28): Client->post() #3 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Installer.php(177): Client->hasBacklight() #4 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Installer.php(29): Installer->attemptLogin() #5 /vhost/p/h/o/photolens.co.uk/www/backlight/installer/index.php(18): Installer->process() #6 {main} thrown in /vhost/p/h/o/photolens.co.uk/www/backlight/installer/lib/Client.php on line 136

Hi @DaveC, sorry, I hadn’t realised that the fix was in the installer rather than Backlight itself (they share the same codebase).
I’ve updated the installer. Can you download it using the link in your order email? It’s named Backlight-5-Installer-119.zip. The only changed file is backlight/installer/lib/Client.php. Try uploading that one file and then visiting the installer again.

Phew!

Ben, thanks a lot - you are a magician!!

Back in the day when I used html to design sites, I was fairly adept at spotting missing commas, etc, but I haven’t bothered with php! So once again, thank you.

Dave.

1 Like

Hi @DaveC, I’m glad that solved it! The cynical me has often said I could code software to land on the moon and the only thing I would be noticed for was a missing comma…
The reason it hadn’t been picked up is that the particular section of code only runs when the web server runs behind a proxy server on different ports. It was perhaps coded for one support case, and your particular setup on your host also triggers that condition. The setup is not an issue, other than failing on that bug that crept in at some point.