Changing PHP version to PHP settings does not affect PHP version in console.
The command to view the current PHP version:
php -v
There are several ways to work in the console with a specific PHP version:
source ~/.bashrc
or . ~/.bashrc
, or just reconnect via SSH.The installed version will be valid for all new SSH connections.
/usr/local/php4/bin/php /usr/local/php52/bin/php /usr/local/php53/bin/php /usr/local/php54/bin/php /usr/local/php55/bin/php /usr/local/php56/bin/php /usr/local/php70/bin/php /usr/local/php71/bin/php /usr/local/php72/bin/php /usr/local/php73/bin/php /usr/local/php74/bin/php /usr/local/php80/bin/php
To work with Composer use the method with version change via control panel or overriding PATH... Also, aliases are not suitable for use in PHP scripts, Bash scripts and cron - in them, be sure to indicate the full the absolute path to the PHP interpreter the version you want.
To create an alias for the required PHP version through the control panel, do the following:
source ~/.bashrc
or . ~/.bashrc
, or just reconnect via SSH.PATH
by running the command (in the command, replace php80
to the required PHP version):export PATH=/usr/local/php80/bin:$PATH
The installed version will only work for the current SSH connection. To make the version work for new connections, use the method with version change via control panel.
from 2-00 to 7-00