<p>You are running PHP 5.6.30 on the command line (read the error message), which you can also verify with <code>php -v</code>.</p>

<p>To swap the PHP, you should add the path to your preferred PHP executable to your shell’s configuration file (e.g. ~/.bash_profile, ~/.bashrc, ~/.zshrc).</p>

<pre><code>export PATH="/Applications/MAMP/bin/php/php7.1.1/bin:$PATH"
</code></pre>

<p>Another option is to ignore the PHP requirement using <a href="https://getcomposer.org/doc/03-cli.md#create-project" rel="nofollow noreferrer"><code>--ignore-platform-reqs</code></a></p>

<pre><code>composer create-project craftcms/craft . -s beta --ignore-platform-reqs
</code></pre>

<p>and then <a href="https://getcomposer.org/doc/06-config.md#platform" rel="nofollow noreferrer">fake the PHP version</a> in the project’s composer.json for later updates</p>

<pre><code>"config": {
  "optimize-autoloader": true,
  "platform": {"php": "7.0"}
},
</code></pre>

CC BY-SA 3.0
2017-05-29T11:18:25.873Z
2017-05-31T09:36:28.433Z
2017-05-31T09:36:28.433Z
carlcs
<p>Why do I get the error when I try to install Craft 3?</p>

<pre><code>composer create-project craftcms/craft Documents/Development/Project -s beta
</code></pre>

<p>The error:</p>

<pre><code>[InvalidArgumentException]                                                                                           
Could not find package craftcms/craft with stability stable 
in a version installable using your PHP version 5.6.30.
</code></pre>

<p>I am running PHP 7.1.</p>

<installation><craft3><composer>
PHP version issue when installing Craft 3 using Composer
# PHP version issue when installing Craft 3 using Composer

(Asked by: username_0 on 2017-05-29)

Why do I get the error when I try to install Craft 3?
composer create-project craftcms/craft Documents/Development/Project -s beta

The error:
[InvalidArgumentException]                                                                                           
Could not find package craftcms/craft with stability stable 
in a version installable using your PHP version 5.6.30.

I am running PHP 7.1.

**Tags:** installation, craft3, composer

---

## 1 answers

### Answer by username_1 on 2017-05-29. Score: 3

You are running PHP 5.6.30 on the command line (read the error message), which you can also verify with php -v.
To swap the PHP, you should add the path to your preferred PHP executable to your shell’s configuration file (e.g. ~/.bash_profile, ~/.bashrc, ~/.zshrc).
export PATH="/Applications/MAMP/bin/php/php7.1.1/bin:$PATH"

Another option is to ignore the PHP requirement using --ignore-platform-reqs
composer create-project craftcms/craft . -s beta --ignore-platform-reqs

and then fake the PHP version in the project’s composer.json for later updates
"config": {
  "optimize-autoloader": true,
  "platform": {"php": "7.0"}
},


---

