Yes you’ll need to upgrade your PHP version, maybe check whats installed first as you seem to have 7.4 php-cli , so you will want to delete old packages first Php version upgrade
So probably just apache/nginx packages that needs correcting Http 500 after upgrade