<p>Add this line to your ~/.bash_profile file</p>

<pre><code>export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.0.0/bin:${PATH}"
</code></pre>

<p>Assuming your php7 version in mamp is 7.0.0 of course.</p>

<p>Here is a link with a few more steps if you aren't sure how to edit that file - <a href="https://gist.github.com/irazasyed/5987693" rel="nofollow noreferrer">https://gist.github.com/irazasyed/5987693</a></p>

CC BY-SA 3.0
2018-01-09T17:37:35.627Z
Many thanks for your help John - it's great to have this sorted!
Janine
CC BY-SA 3.0
2018-01-09T15:13:21.307Z
2018-01-09T15:13:21.307Z
John
<p>Recent versions of macOS High Sierra come with PHP 7.1.7, so another option is you can try upgrading your OS.</p>

CC BY-SA 3.0
2018-01-09T15:40:10.063Z
2018-01-09T15:40:10.063Z
Brandon Kelly
<p>I'm new to Composer and am using a Mac along with MAMP as a local web server. I've installed Composer but it's referencing an old PHP 5 version that must be the default on my Mac.</p>

<p>I was able to install Craft 3 via Composer by adding the --ignore-platform-reqs flag as per <a href="https://docs.craftcms.com/v3/installation.html#downloading-with-composer" rel="nofollow noreferrer">https://docs.craftcms.com/v3/installation.html#downloading-with-composer</a></p>

<p>The Craft 3 starter project files were all added successfully. However, at the end of the install output in terminal was the following:</p>

<pre><code>@php craft setup/welcome
Craft requires PHP 7.0 or later.
</code></pre>

<p>If I navigate to the project install directory and try running ./craft setup I get the same message "Craft requires PHP 7.0 or later".</p>

<p>The installation docs did say you could alternatively edit the .env file directly, so I entered the database details in there instead. But when I went to access the browser install wizard, I got errors about the security key being missing.</p>

<p>Now I worked around that by just generating a random 32 character string myself and entering this for the SECURITY_KEY setting in the .env file &amp; was then able to complete the install wizard.</p>

<p>However, I'm wondering if that is OK to do? I'm concerned that there may be a particular format needed etc and that just pasting in my own key could cause issues down the line.</p>

<p>Ideally I'd prefer to be able to just complete the standard setup via terminal instead and have the key config automatically set there. Is there a way I can get the craft setup command to use the newer PHP 7+ available from MAMP? Or is there an easy way to update the default PHP version Composer references without disturbing the rest of my Mac?</p>

<php><craft3><install><composer>
Problem setting security key when installing Craft 3
# Problem setting security key when installing Craft 3

(Asked by: username_0 on 2018-01-05)

I'm new to Composer and am using a Mac along with MAMP as a local web server. I've installed Composer but it's referencing an old PHP 5 version that must be the default on my Mac.
I was able to install Craft 3 via Composer by adding the --ignore-platform-reqs flag as per https://docs.craftcms.com/v3/installation.html#downloading-with-composer
The Craft 3 starter project files were all added successfully. However, at the end of the install output in terminal was the following:
@php craft setup/welcome
Craft requires PHP 7.0 or later.

If I navigate to the project install directory and try running ./craft setup I get the same message "Craft requires PHP 7.0 or later".
The installation docs did say you could alternatively edit the .env file directly, so I entered the database details in there instead. But when I went to access the browser install wizard, I got errors about the security key being missing.
Now I worked around that by just generating a random 32 character string myself and entering this for the SECURITY_KEY setting in the .env file & was then able to complete the install wizard.
However, I'm wondering if that is OK to do? I'm concerned that there may be a particular format needed etc and that just pasting in my own key could cause issues down the line.
Ideally I'd prefer to be able to just complete the standard setup via terminal instead and have the key config automatically set there. Is there a way I can get the craft setup command to use the newer PHP 7+ available from MAMP? Or is there an easy way to update the default PHP version Composer references without disturbing the rest of my Mac?

**Tags:** php, craft3, install, composer


---

## 2 answers

### Answer by username_1 on 2018-01-09. Score: 2 | Accepted answer

Add this line to your ~/.bash_profile file
export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.0.0/bin:${PATH}"

Assuming your php7 version in mamp is 7.0.0 of course.
Here is a link with a few more steps if you aren't sure how to edit that file - https://gist.github.com/irazasyed/5987693

> **Comments:**
> **username_0**: Many thanks for your help username_1 - it's great to have this sorted!  

---

### Answer by username_2 on 2018-01-09. Score: 2

Recent versions of macOS High Sierra come with PHP 7.1.7, so another option is you can try upgrading your OS.


---

