This article provides instructions for changing the PHP version used in command line interface through SSH.
Follow the steps-
- Connect through SSH.
- If the file does not exit, create a “.profile” file-
touch ~/.profile - Modify the .profile file-
nano ~/.profile - Now, add this code to the file to select the required php version-
export PATH=/opt/php7.4/bin:$PATH
- Load the .profile file-
source ~/.profile - Finally, Check the php version-
php –v
In such a manner, you can change the PHP version used in the command line interface through SSH.
Also Read: How to change the PHP version for a website in Plesk