Update php version in mom

I am using the latest version of the MAMP server. In my settings for the MAMP php version, I can find the latest version 7.1.1, but when I start php -v, I get like this:

PHP 5.5.14 (cli) (built: Sep  9 2014 19:09:25) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

I can’t update it. Please help me.

IN MAMP/bin/php/

no folder type php5.5.14
+6
source share
1 answer

This is because it refers to the pre-installed PHP of your OSX. You need to change this to point to your MAMP PHP. To do this, you need to edit .bash_profileusing a text editor and add the version of PHP MAMP to the variable PATH.

Follow these steps ( source ):

  • In the terminal, run
vim ~/.bash_profile
  1. i, :
export PATH=/Applications/MAMP/bin/php/php7.1.1/bin:$PATH
  1. ESC, :wq Enter

  2. :

 source ~/.bash_profile
  1. php . , MAMP PHP.

, ( ) , .

+10

Source: https://habr.com/ru/post/1015093/


All Articles