php from command line empty

吃可爱长大的小学妹 提交于 2019-12-11 05:27:10

问题


I have updated windows today and now when I use the command line and type PHP nothing returns. tried various PHP commands, nothing, not even an error or response. blank.

I had the correct path in the environment variables. Tried to change to another PHP version and even tried removing the path from environment variables but still returns empty! It doesn't even say that "PHP" is not recognized although I removed the environment variable!!

I have no clue how to solve this.


回答1:


If you are not passing extra parameters when you call it from command line, that´s how it supposed to work.

Try running:

php --help (to see all options from command line)

Also, to make sure it is running try to do this:

php -v (to check version)
php -F filename.php

The last one should run your php file.




回答2:


I had the same challenge. Here's a solution:

  1. Use a standard terminal window (instead of Powershell).
  2. Try php -v again.
  3. IF you get an error mentioning VCRUNTIME140.dll
  4. THEN you need to install run-time components that are required to run C++ applications built using Visual Studio 2015 here: https://www.microsoft.com/en-us/download/details.aspx?id=48145


来源:https://stackoverflow.com/questions/44257456/php-from-command-line-empty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!