本文介绍了作曲家如何检查php版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道作曲家在检查需求时如何检查要使用哪个php.我使用MacOS,并且在终端类型中:

I just wondering how composer check which php to use when check for requirements. I use MacOS and in terminal type:

composer require phpunit/phpunit

结果类似于:

Problem 1
- phpunit/phpunit 5.0.4 requires php >=5.6 -> your PHP version (5.5.27) or "config.platform.php" value does not satisfy that requirement....

当我检查php版本时:

When I check php version:

php -v

结果是:

哪个是:

which php

php:别名为/Applications/MAMP/bin/php/php5.6.10/bin/php

php: aliased to /Applications/MAMP/bin/php/php5.6.10/bin/php

有人可以解释这一点吗?预先感谢!

Can someone explain this. Thanks in advance!

推荐答案

如果指定调试详细信息-vvv,Composer可以告诉您正在运行的PHP版本.

Composer can tell you what version of PHP it's running on, if you specify debug verbosity -vvv.

我喜欢用about命令运行它,因为输出相对较短.

I like to run it with the about command, since the output is relatively short.

composer -vvv about

示例输出:

这引起了人们的兴趣,超出了我的预期,因此这是一个输出更干净的版本:

This has gotten more interest than I expected, so here's a version with cleaner output:

composer -vvv about 2>&1 | grep "PHP"

这篇关于作曲家如何检查php版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 09:28
查看更多