Most likely you switched to the wrong PHP default version like PHP 8 or 8.1. check that PHP, php-cgi and also mod_php versions are still at the original version from Ubuntu 18.04.