PHP 7.1.7 was installed on macOS High Sierra. Through Brew installed PHP 7.2.

When outputting data via phpinfo() shows version 7.1.7, but in a terminal via php -v shows 7.2

 $ which php /usr/local/bin/php /usr/local/bin/php -v PHP 7.2.1 (cli) (built: Jan 5 2018 17:34:14) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies $ whereis php /usr/bin/php $ /usr/bin/php -v PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans 

Who knows how to specify the latest version? To everywhere it was all the same.

thank

  • What is “everywhere was the same”? - de_frag
  • You in the terminal see the version in the folder where php , in particular, there is a php file here /usr/local/bin/php php, so you are given 7.2. The version that is processed by default is the one shown in phpinfo(); - Alexey Shatrov

0