Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stratboy's avatar

Is it safe to update php version on my mac?

Hi, I'm on my first steps with Laravel and not a Terminal expert at all, as well as applications in general. I'm just a php/js programmer.

So laravel new testsite gave me an output of this type:

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 ^7.1.3 but your PHP version (5.6.30) does not satisfy that requirement.
  Problem 2
    - Installation request for doctrine/inflector v1.3.0 -> satisfiable by doctrine/inflector[v1.3.0].
    - doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 3
    - Installation request for dragonmantank/cron-expression v2.2.0 -> satisfiable by dragonmantank/cron-expression[v2.2.0].
    - dragonmantank/cron-expression v2.2.0 requires php >=7.0.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 4
[etc... almost 40 problems]

Therefore, the first thing I gues I should do is to update my php version. My question is: is it safe for me to update my php version? Should I simply brew install [email protected]?

Currently running MacOS Sierra 10.12.6

0 likes
2 replies
stratboy's avatar

Ok for now I was able to solve by passing MAMP's php version to my bash:

export PATH=/Applications/MAMP/bin/php/php7.1.19/bin:$PATH

Then I was able to install Laravel without any issue.

As a side note: strangely enough, when I was trying to use Brew, I could't update Brew version. No way. Brew update just keepd freezing and do nothing.

jorgecortesdev's avatar

Hi, yes it is safe to do it, I do it all the time, actually you can have multiple versions of php installed on your machine:

➜  ~ ls -l /usr/local/bin/php
lrwxr-xr-x  1 jcortes  admin  28 Sep 27 18:55 /usr/local/bin/php -> ../Cellar/php/7.2.10/bin/php

they are only symlinks to the version that you want to use.

1 like

Please or to participate in this conversation.