skip to Main Content

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


  1. 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!";'

    Login or Signup to reply.
  2. To run PHP in an interactive mode you need to pass the -a flag

    example :

    php -a or C:Program FilesPHPv7.3php.exe -a

    Running both php or C:Program FilesPHPv7.3php.exe will cause the terminal to hang and a CLI php process to start

    You can quit the process by pressing Ctrl + C

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search