MeesterMarcus
MeesterMarcus

Reputation: 710

Why is my php -v version different from phpinfo()?

I looked at some of the similar questions and they have a similar problem except their php -v version is the one that is higher than the phpinfo() reported version. For when I call phpinfo() from php file it shows 5.5.25 which is correct. In the terminal through ssh I run php -v and it gives me 5.4.43. I'm using GoDaddy hosting and on cPanel I have it set to 5.5. I'm using Composer and Laravel. When I create a new Laravel project it gives me this error:

[~/public_html]$ laravel new blog
Crafting application...
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
Script php artisan clear-compiled handling the post-install-cmd event returned with an error



  [RuntimeException]
  Error Output:



run-script [--dev] [--no-dev] [-l|--list] [script] [args1] ... [argsN]


Application ready! Build something amazing.

Upvotes: 2

Views: 1280

Answers (1)

user2182349
user2182349

Reputation: 9782

You need to use a different path to get to the right version of the command line PHP.

Use

which -a php

To get the paths to the available versions of PHP, then use the full pathname.

For example

/usr/bin/php5

Upvotes: 1

Related Questions