I'm trying to install the composer on my website, but the server is running PHP 5.2, and the more I change my version of PHP by cpanel, it continues running PHP 5.2 on the command line.
When I run the php -v he passes me that the version of PHP is 5.2
Is there any way I can change the version of PHP in the command line? Or something like this.
Without knowing the setup it is hard to advise you but this may work:
Usually when multiple PHP versions are present, a symlink is used to point
/usr/bin/php
to the version of PHP binary that should be active.Firstly find out where the php executable is being picked from. This you can do by typing
which php
. This will tell you where php is being picked from. Now go to that folder and dols -l
and check if the php executable is a symlink. If it is a symlink you can delete the symlink and create a new one in its place that points to the correct PHP version binary.