How do I change PHP version in shell?
I have setup my account to use PHP v5.6 through cPanel. I then used phpinfo() to verify that I am using 5.6. However, when I login via SSH (command line/shell) and type "php -v", it shows I'm using PHP v5.4. I need to run some PHP through command line, but I need these commands to use 5.6, not 5.4. How do I update the shell to use 5.6?
Next, find and open the file in your home directory called ".bashrc". Add the following line to the end of the document (without quotes): "alias php=/opt/php56/bin/php" (change the PHP path if you want a different version)
Save the file. SSH back into your server and any "php" commands you use will now use the version specified in the bashrc file. Run "php -v" to verify.