Operating system: MAC OS
The script v.php opened by the browser
<?php
phpinfo();
输出的版本是``PHP Version 5.6.30``
The command line executes php v.php, the output version is:
PHP 7.1.6 (cli) (built: Jun 26 2017 00:06:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
Is this what is the reason?
Maybe there are two versions of PHP on the computer.
The PHP version used by the localhost server mounted by Apache is 5.6;
The PHP version used by the global php command is 7.1.
Amend this sentence in /etc/apache2/httpd.conf
There is also a function to load configuration
Modify php7.conf
Modify httpd.conf