marcelo2605
marcelo2605

Reputation: 2794

Composer is not getting my new PHP version

I'm trying to install a package that requires PHP ^7.0. So I changed my host PHP version from 5.6 to 7.0.25. Running php -v return:

PHP 7.0.25 (cli) (built: Oct 30 2017 17:10:45) ( NTS )

But composer still relating version problem:

  • spatie/laravel-backup 4.19.2 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.

Upvotes: 1

Views: 3936

Answers (1)

Oulalahakabu
Oulalahakabu

Reputation: 489

You probably still have php5.6-cli installed on your server (which php) It should work if you call

/path/to/php7 composer.phar update

Or

Considering php7 executable is /usr/bin/php7.0, create an alias in your ~/.bash_profile

alias composer='/usr/bin/php7.0 /usr/local/bin/composer'

Or

By default, composer (composer.phar generally located in /usr/local/bin/composer) uses the executable specified by env :

#!/usr/bin/env php

You can also specify a targeted version of php to use :

#!/usr/bin/php7.0

Or

completely remove php5.6-cli :)

Upvotes: 6

Related Questions