简体   繁体   中英

php from command line empty

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM