Find the version the website runs
The command-line PHP over SSH can differ from the build the web server uses. Check the response header, the hosting panel, or a temporary probe file that you delete straight away.
curl -sI https://example.com | grep -i x-powered-by
# or a one-line probe file with a random name, opened once, then deleted:
# <?php echo PHP_VERSION, ' ', PHP_SAPI;