skip to Main Content

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


  1. You can write the complete path to the PHP executable and use the version directly.

    /opt/plesk/php/7.0/bin/php my_script.php
    

    you can replace the 7.0 with any php version you’ve installed on your system.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search