问题
I'm using a PHP script which expects user input from a command like fgets(STDIN)
. The problem is it no longer works in the newest version of PHPStorm (10).
The same works when I run it directly (without debugger enabled) and anything I enter in the console is sent to the script (on direct run).
But during a debug session, when I try to input text at the script's prompt, it does not go to the script. My best guess is that the new REPL feature is overriding user input in console during debugging. I say this because pressing the UP/DOWN arrows opens up a popup with all PHP function names.
It used to work correctly with last version.
How can I send user input to my PHP script with this new version? Am I missing something here?
回答1:
I'm not sure if this is the same thing, but I was running into this same problem, and I was able to get it working by deselecting the "Use Console Input" checkbox in the PHPStorm Console.
回答2:
John's answer is perfect. I want to mention that the Use Console Input is a tiny icon in sidebar of the debug console. I provide you by this image
来源:https://stackoverflow.com/questions/34438892/phpstorm-console-input-not-working-during-debug-sessions