Skip to main content
1 of 3
Whip
  • 125
  • 1
  • 8

Composer detecting older version of PHP

I'm trying to install Magento 2 via composer and following this link for instructions. In step 2,

composer install

I get a php version error.

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php ~5.5.0|~5.6.0|~7.0.0 but your PHP version (5.3.29) does not satisfy that requirement.
  Problem 2
    - Installation request for magento/composer 1.0.2 -> satisfiable by magento/composer[1.0.2].
    - magento/composer 1.0.2 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (5.3.29) does not satisfy that requirement.
  Problem 3
    - Installation request for pelago/emogrifier v0.1.1 -> satisfiable by pelago/emogrifier[v0.1.1].
    - pelago/emogrifier v0.1.1 requires php >=5.4.0 -> your PHP version (5.3.29) does not satisfy that requirement.
  Problem 4
    - Installation request for league/climate 2.6.1 -> satisfiable by league/climate[2.6.1].
    - league/climate 2.6.1 requires php >=5.4.0 -> your PHP version (5.3.29) does not satisfy that requirement.
  Problem 5
    - Installation request for sjparkinson/static-review 4.1.1 -> satisfiable by sjparkinson/static-review[4.1.1].
    - sjparkinson/static-review 4.1.1 requires php >=5.4.0 -> your PHP version (5.3.29) does not satisfy that requirement.
  Problem 6
    - Installation request for symfony/stopwatch v3.2.1 -> satisfiable by symfony/stopwatch[v3.2.1].
    - symfony/stopwatch v3.2.1 requires php >=5.5.9 -> your PHP version (5.3.29) does not satisfy that requirement.
  Problem 7
    - colinmollenhour/php-redis-session-abstract v1.1 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (5.3.29) does not satisfy that requirement.
    - colinmollenhour/php-redis-session-abstract v1.1 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (5.3.29) does not satisfy that requirement.
    - Installation request for colinmollenhour/php-redis-session-abstract v1.1 -> satisfiable by colinmollenhour/php-redis-session-abstract[v1.1].

I changed my php version in cpanel to 5.5 but using php -v still showed 5.3. So I followed this link to add an alias to ~/.bashrc file

alias php=/opt/php56/bin/php

Logged out and back in to SSH and php -v returns 5.5. Went back to install composer and it showed the exact same error. I've also did what was mentioned on this answer but it didn't work either.

How do I update php for composer?

Whip
  • 125
  • 1
  • 8