Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-29T11:18:25.873Z
Answers.LastActivityDate: 2017-05-31T09:36:28.433Z
Answers.LastEditDate: 2017-05-31T09:36:28.433Z
Answers.UserDisplayName: carlcs
Body: <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>
  
Tags: <installation><craft3><composer>
Title: PHP version issue when installing Craft 3 using Composer
ThreadText: # 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`](https://getcomposer.org/doc/03-cli.md#create-project)
  
  ```
  composer create-project craftcms/craft . -s beta --ignore-platform-reqs
  
  ```
  
  and then [fake the PHP version](https://getcomposer.org/doc/06-config.md#platform) in the project’s composer.json for later updates
  
  ```
  "config": {
    "optimize-autoloader": true,
    "platform": {"php": "7.0"}
  },
  
  ```
  
  
  ---
  
  