Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPstorm console input not working during debug sessions

Tags:

phpstorm

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?

like image 551
supersan Avatar asked Dec 23 '15 15:12

supersan


People also ask

Why is xdebug not working?

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.

How do I debug PhpStorm?

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.


2 Answers

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.

like image 66
John O Avatar answered Sep 30 '22 19:09

John O


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

enter image description here

like image 24
Armin.G Avatar answered Sep 30 '22 17:09

Armin.G