Link to home
Start Free TrialLog in
Avatar of Julia Lucio
Julia LucioFlag for Canada

asked on

Error triggered when updating site to PHP 8

I have a server with Ionos and I'm using plesk.  My site used PHP 7.4 but now I'm getting a message that it is no longer supported, so I installed PHP 8.0 and two higher versions on the server and switched my site to use PHP 8.0, but when I do, my site throws me a "there has been a critical error on this website".  I need help getting this to work.

ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

Updating to PHP8 and later usully required code adjustment and DB server update too.

Documentation

Migration (select the version)
https://www.php.net/manual/en/migration82.php

Changelogs (each version has a changelogs)
https://www.php.net/ChangeLog-8.php#PHP_8_0

What's new (each version has a what's new page)
https://www.php.net/releases/8.2/en.php

I'm using PHPCompatibility script to scan the code this find most problem
https://github.com/PHPCompatibility/PHPCompatibility

I also use PHP error logs to catch other errors that cannot be find using the scanner for example
with 8.2 NULL result is managed differently and most PHP function are affected by this.
So this will required more fix compare to 8.0 or 8.1

So I recommend you to set up a test environment with the new server settings and completely test your application.
I'm also using Xdegug locally on the test site to display errors on my pages.

Using wampserver on your test site locally you will have xdebug and be able to switch between PHP version and MYSQL version which is handy.

Don't forget to scan vendors directory if you use any.