douyun4524 2019-07-13 08:12
浏览 164

在命令行中显示两个不同的PHP版本

I installed laravel project 5.1 which is working fine but artisan commands are not working throwing each() error which is deprecated in php 7.1. When I run phpinfo() it shows php version 5.6 and on command line there's also two versions are showing

when run

phpinfo();
5.6

when run on command Line in xampp folder

C:/xampp> php -v;
5.7

when run in command in this xammpp/php directory

C:/xampp/php> php -v;
5.6
  • 写回答

1条回答 默认 最新

  • douhan9191 2019-07-13 08:17
    关注

    This is because there are CLI version and WEB version.

    How JakeGould says:

    Don’t panic! If you are concerned about what PHP version your Apache server is using, the output of phpinfo() is always what you should pay attention to. The Apache PHP module and the PHP command line binary are two different things that don’t interfere with each other.

    In fact you can compile and load various PHP versions you want to work with Apache as long as you adjust Apache to properly load it. The PHP command line interface will never come into play in the case of Apache parsing PHP pages.

    The command line version of PHP is simply there for command line specific tasks and the PHP module for Apache will never touch, use or need that.

    source: https://superuser.com/a/971895

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据