# Can't install Sage with composer create-project due to php version error

**URL:** https://discourse.roots.io/t/cant-install-sage-with-composer-create-project-due-to-php-version-error/10169
**Category:** sage
**Created:** 2017-08-09T02:24:59Z
**Posts:** 11

## Post 1 by @richard — 2017-08-09T02:24:59Z

Trying to install Sage 9 via composer into a wordpress install running php 7.1.4 with:

```
composer create-project roots/sage sagetest dev-master
```

but am getting this error:

```
Could not find package roots/sage with version dev-master in a version installable using your PHP version 5.6.30
```

phpinfo(); confirms I am running php 7.1.4

Thoughts on this? Thanks in advance

---

## Post 2 by @ben — 2017-08-09T02:33:51Z

Is your `phpinfo` output the same as your PHP CLI though? What happens when you try `php -v`?

---

## Post 3 by @richard — 2017-08-09T02:55:40Z

Oh damn, yeah, that’s the issue. :confused:

Thanks!

---

## Post 4 by @mecanographik — 2017-08-25T12:44:11Z

Hi @richard @ben  
I have the same issue i have php -v **5.6.30** so i have tried to install php 7 on my system with :  
`curl -s https://php-osx.liip.ch/install.sh | bash -s 7.1`

but i still get php -v 5.6.30 in my terminal

also, in my .bash\_profile i have those lines :

```
export PATH="/Applications/MAMP/Library/bin:$PATH"
alias composer="php /usr/local/bin/composer.phar"
alias wpinstall="~/Scripts/wpinstall.sh"

export NVM_DIR="/Users/Mecanographik/.nvm"

[-s "$NVM_DIR/nvm.sh"] && . "$NVM_DIR/nvm.sh"  
# This loads nvm
#source ~/.bashrc

export PATH="$HOME/.yarn/bin:$PATH"
```

any help would be really appreciated ! :sweat_smile:

---

## Post 5 by @mecanographik — 2017-08-25T13:03:27Z

Hi @ben  
Nevermind i have managed to fix my problem with brew using this ressource :

> <https://stackoverflow.com/questions/41872645/updating-php-version-on-mac>

```
brew update && brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew unlink php56  
brew install php71
```

than in your terminal, type:  
export PATH=/usr/local/php5/bin:$PATH

now i have php 7.1 version on my system and the following command works :wink::rocket:

`composer create-project roots/sage your-theme-name dev-master`

Hope it helps someone else

---

## Post 6 by @kiryl — 2017-09-26T19:57:30Z

Have same issue.

```
php -v
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
```

**composer create-project roots/sage your-theme-name dev-master** runs to:

```
Installing roots/sage (dev-master b4421be2696bd6021a11eb6893bb6fbb8a949d15)
  - Installing roots/sage (dev-master master)
    Cloning master

Created project in your-theme-name
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
    - Installation request for illuminate/support v5.4.27 -> satisfiable by illuminate/support[v5.4.27].
    - illuminate/support v5.4.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
  Problem 2
    - Installation request for squizlabs/php_codesniffer 2.9.1 -> satisfiable by squizlabs/php_codesniffer[2.9.1].
    - squizlabs/php_codesniffer 2.9.1 requires ext-simplexml * -> the requested PHP extension simplexml is missing from your system.
  Problem 3
    - illuminate/support v5.4.27 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - illuminate/console v5.4.27 requires illuminate/support 5.4.* -> satisfiable by illuminate/support[v5.4.27].
    - Installation request for illuminate/console v5.4.27 -> satisfiable by illuminate/console[v5.4.27].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php/7.0/cli/php.ini
    - /etc/php/7.0/cli/conf.d/10-opcache.ini
    - /etc/php/7.0/cli/conf.d/10-pdo.ini
    - /etc/php/7.0/cli/conf.d/20-calendar.ini
    - /etc/php/7.0/cli/conf.d/20-ctype.ini
    - /etc/php/7.0/cli/conf.d/20-exif.ini
    - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.0/cli/conf.d/20-ftp.ini
    - /etc/php/7.0/cli/conf.d/20-gettext.ini
    - /etc/php/7.0/cli/conf.d/20-iconv.ini
    - /etc/php/7.0/cli/conf.d/20-json.ini
    - /etc/php/7.0/cli/conf.d/20-phar.ini
    - /etc/php/7.0/cli/conf.d/20-posix.ini
    - /etc/php/7.0/cli/conf.d/20-readline.ini
    - /etc/php/7.0/cli/conf.d/20-shmop.ini
    - /etc/php/7.0/cli/conf.d/20-sockets.ini
    - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
```

---

## Post 7 by @ben — 2017-09-26T20:12:30Z

[Please read the post above yours](https://discourse.roots.io/t/cant-install-sage-with-composer-create-project-due-to-php-version-error/10169/5)

---

## Post 8 by @kiryl — 2017-09-26T20:15:53Z

But I already have “php”: “\>=7”, mentioned by php -v

---

## Post 9 by @kalenjohnson — 2017-09-26T20:23:22Z

Please READ the error you pasted

You’re missing PHP extensions

---

## Post 10 by @kiryl — 2017-09-26T21:09:19Z

Thank you, guys. Sharing my expirience in Ubuntu Linux.  
Composer has obsolete PHP\_CodeSniffer version.

```
sudo apt-get install nfs-kernel-server
sudo apt-get update && sudo apt-get install php-mbstring
sudo apt install php-pear && sudo pear install PHP_CodeSniffer
```

---

## Post 11 by @Simeon — 2018-05-14T01:23:25Z

> [@mecanographik](#):
>
> brew update && brew upgrade  
> brew tap homebrew/dupes  
> brew tap homebrew/versions  
> brew tap homebrew/homebrew-php  
> brew unlink php56  
> brew install php71

Some of these have been depreciated. A helpful, more recent blog post here:

> **[Migrate your local PHP 7.2 setup to Homebrew v1.5 - Andy Grunwald](https://andygrunwald.com/blog/migrate-your-local-php-7.2-setup-to-homebrew-v1.5/)**
>
> Homebrew v1.5 changed the way how the PHP programming language packages are installed. This blog post is a small guide on how you migrate your local Homebrew PHP setup while updating to Homebrew v1.5.

Came across this problem this morning on a fresh install of Sage where the error similar to _cannot satisfy requirements_ because I had php7.1 locally and needed greater than that.

Also didn’t realise composer was looking at my system’s php, not the virtual machine’s…

Hope this helps.
