phpinfo.php和php-v之间的结果不同 [英] different result between phpinfo.php and php-v

查看:228
本文介绍了phpinfo.php和php-v之间的结果不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用appserv 5.8 在我的phpinfo.php中,php版本是5.6.26 现在我安装了laravel5.5 及其所需的phpversion 7 所以我将PHP版本从5更改为7 现在在我的phpinfo.php

i was using appserv 5.8 and in my phpinfo.php the php version was 5.6.26 now i installed laravel5.5 and its required phpversion 7 so i changed the php version to 7 from 5 now in my phpinfo.php

PHP Version 7.0.11

当我写命令

php -v

它给了我

PHP 5.6.26 (cli) (built: Sep 15 2016 18:12:07)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

并且我无法使用laravel 5.5 BC安装软件包,命令行中的版本是5.6而不是7 但是当我签入phpinfo它的7 我已经读到了多数民众赞成在命令php -v钉从php-cli版本 所以我怎样才能将php -v更改为7.0.1作为phpinfo.php 谢谢..

and i cant install the packages with laravel 5.5 bc the version in command line is 5.6 not 7 but when i check in phpinfo its 7 i have read something thats the command php -v tack the version from php-cli so how can i change the php -v to be 7.0.1 as phpinfo.php thanks ..

推荐答案

phpinfo.php显示Apache正在使用的PHP版本. -v显示$ PATH中的内容.

phpinfo.php shows what version of PHP Apache is using. -v shows what's in your $PATH.

如果您使用的是Mac,我建议按照

If you're on a Mac I recommend using homebrew to install php 7 as described here

为澄清起见, PHP可以通过三种方式运行:在Web服务器后面,用于命令行脚本和用于GUI构建.您有2个版本:一个是Web服务器,一个是Apache调用并调用phpinfo.php的版本,另一个是 PHP-CLI ,通过php -v在命令行中调用.

To clarify, PHP can be run in 3 ways: behind a web server, for command line scripting, and for GUI building. You have 2 versions: the web server one, which Apache is calling and invoking phpinfo.php, and PHP-CLI, which is invoked from the command line with php -v.

这篇关于phpinfo.php和php-v之间的结果不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆