When you switch to a newer PHP version and experience an error message when visiting your website, it usually means that a plugin or theme on your website does not yet support the PHP version you switched to.
Always check the error log in DirectAdmin first. This will help you pinpoint the specific error on your website. The error log often shows you exactly which file and line is causing the problem.
You can always switch back to the previously set PHP version until you have resolved the issue.
Manually disable a WordPress plugin or theme
When you have a WordPress website and a message appears in the error log that refers to a plugin you are using after changing the PHP version, you can try manually disabling the plugin to see if it resolves the issue.
For WordPress, you can manually disable a plugin by, for example, navigating via 'File Manager' in DirectAdmin to the following folder and then renaming the plugin's folder using 'Rename':
/yourdomain.com/public_html/wp-content/plugins/
To disable a theme, do not navigate to the 'plugins' folder, but to the 'themes' folder:
/yourdomain.com/public_html/wp-content/themes/
If the folder of the plugin or theme is named 'example' and you rename it to 'example_', the plugin or theme will be deactivated. If this solves the problem, you know that the cause lies there.
You can then contact the developer of the plugin or theme to ask if they are aware of the error message that appeared under a specific PHP version.