PhpStorm Xdebug with xdebug.remote_mode="jit" results in Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

I am attempting to activate Just In Time debugging with PhpStorm so that I can pickup a discrete and non-fatal error that php.ini cannot switch off.

In php.ini:

[Xdebug]
zend_extension="xdebug.so"
xdebug.remote_enable=true
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Users/mrbungle/temp/"
xdebug.profile_enable_trigger=1
xdebug.trace_enable_trigger=1
xdebug.remote_mode="jit"
xdebug.idekey="PHPSTORM"
xdebug.remote_log="var/log/xdebug/xlog"

I am also using the recommended(by Phpstorm) debugger plugin in Safari to toggle debugging (yes its on).

When the error occurs an attempt is made to connect to Phpstorm debugger.

Phpstorm reports:

13:44   Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

Xdebug log reports:

Log opened at 2017-07-11 12:54:50
I: Connecting to configured address/port: localhost:9000.
W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (19).
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/mrbungle/Sites/t/public/index.php" language="PHP" xdebug:language_version="7.1.5" protocol_version="1.0" appid="39463" idekey="1"><engine version="2.5.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- feature_set -i 4 -n extended_properties -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" status="starting" reason="ok"><error code="3"><message><![CDATA[invalid or missing options]]></message></error></response>

<- status -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="5" status="starting" reason="ok"></response>

<- step_into -i 6
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="6" status="stopping" reason="ok"></response>

<- eval -i 7 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="7"><error code="5"><message><![CDATA[command is not available]]></message></error></response>

Log closed at 2017-07-11 12:54:50

Anyone seen this or can help?

Are you sure the path to xdebug.so is correct ? The file should exists in the directory specified by the extension_dir setting in php.ini.



22.2k

Yep the path is correct. As it turned out I needed to add config to the Server section in php storm.

Are you sure the path to xdebug.so is correct ? The file should exists in the directory specified by the extension_dir setting in php.ini.