I use Debian. I wanted check my php version. I typed but by mistake
php
instead of
php - v
. And then “php command line” won’t take any commands anymore from me. No error no reaction.
I can stop this process using kill command, but I want to know, what is ‘php’ without option for. And how to stop it, without kill command.
Press Ctrl+D to send EOF (end-of-file) to PHP, which will cause it to exit. Or press Ctrl+C to kill it with a SIGINT signal.
Explanation: With no command-line arguments PHP is expecting code to be provided on standard input, which is connected to your terminal. This is standard behavior for many UNIX programs, not just PHP. You can type code manually and then press Ctrl+D when you’re done and PHP will execute the code you typed.
You can see the same behavior with
cat. If you don’t provide a file namecatwill read from stdin and copy it to stdout. Which means it will echo every line you type until you press Ctrl+D to signal EOF.