Moodle 4.2 or later requires at least PHP 8.0.0 (currently using version 7.2.34-26+ubuntu18.04.1+deb.sury.org+1). Some servers may have multiple PHP versions installed, are you using the correct executable?