As stated, numerous times on this forum; CWP (CLI) and webserver PHP versions aren't the same thing, though may be set to be equal versions. In other words, there's system PHP and there's webserver PHP.
You can explicitly use a full path to the directory where a specific PHP version resides.