What are common reasons for PHP showing different versions in the command line compared to a web server?

PHP may show different versions in the command line compared to a web server due to different PHP configurations being used. To ensure the same PHP version is used in both environments, you can specify the PHP version to be used in the command line by updating the PATH environment variable to point to the desired PHP binary.

# Update the PATH environment variable to point to the desired PHP binary
export PATH=/path/to/php/bin:$PATH