I have setup my account to use PHP v7.0 through Plesk. I then used phpinfo() to verify that I am using 7.0. 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 7.0, not 5.4. How do I update the shell to use 7.0?
For example
php composer.phar create-project –prefer-dist cakephp/app my_app_name
I get – cakephp/cakephp 3.6.9 requires php >=5.6.0 -> your PHP version (5.4.16) does not satisfy that requirement.
Any further assistance would be greatly appreciated
2
Answers
Using Plesk all you need to do is following this guide:
https://support.plesk.com/hc/en-us/articles/115003766853-How-to-specify-PHP-version-on-the-Plesk-server-for-command-line-command-php-for-user-
Let me know if you need further help
You can write the complete path to the PHP executable and use the version directly.
you can replace the
7.0
with any php version you’ve installed on your system.