I have PHP added as an env variable – set to C:Program FilesPHPv7.3, but when I run php
from CMD the window locks up and it just hangs indefinitely. When run "C:Program FilesPHPv7.3php.exe" directly then the interactive shell starts normally.
No errors in the event log. Microsoft Visual C++ 2019 redistributable is installed. No other versions of PHP present (though there was an old version installed historically).
2
Answers
Running only the
php
command will cause this problem.php -r
command can be used to run PHP code on CLI. Example:php -r 'echo "Hello world!";'
To run PHP in an interactive mode you need to pass the
-a
flagexample :
php -a
orC:Program FilesPHPv7.3php.exe -a
Running both
php
orC:Program FilesPHPv7.3php.exe
will cause the terminal to hang and a CLI php process to startYou can quit the process by pressing
Ctrl + C