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?
Xdebug cannot connect to PhpStorm This means that Xdebug tries to connect to the host and can't make the connection. To fix the issue, set xdebug. remote_connect_back=0 ( xdebug. discover_client_host=false for Xdebug 3) and make sure that xdebug.
On the PhpStorm toolbar, toggle. to start listening for incoming PHP debug connections, or choose Run | Start Listening for PHP Debug Connections from the main menu. Set a breakpoint in your code. Breakpoints can be set in the PHP context inside PHP, HTML, TWIG, BLADE, and files of other types.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With