1

I have PHP added as an env variable - set to C:\Program Files\PHP\v7.3, but when I run php from CMD the window locks up and it just hangs indefinitely. When run "C:\Program Files\PHP\v7.3\php.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
  • 1
    I have PHP added as an env variable Please show us how you did this Commented Aug 31, 2021 at 13:07
  • System Properties>Environment Variables>append file path; C:\Program Files\PHP\v7.3 Commented Aug 31, 2021 at 13:28

2 Answers 2

1

To run PHP in an interactive mode you need to pass the -a flag

example :

php -a or C:\Program Files\PHP\v7.3\php.exe -a

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

You can quit the process by pressing Ctrl + C

Sign up to request clarification or add additional context in comments.

1 Comment

OK, this does explain the problem and is me misunderstanding how IIS invokes PHP when needed by a site. Sorry, I am fairly new. I was hoping this would be the crux of the problem but it seems PHP is installed and working correctly. Now I need to figure out why my Cisco phone directory site is unable to use this version of PHP. Yay! Thank you, lotfio.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.