Я установил XDebug в код Visual Studio с помощью мастера xdebug.org / wizard.php и установил расширение 'php debug' для VSC.Я попытался отладить некоторый код через браузер, и он работал нормально, но затем я решил отладить тестовый файл прямо в VSC с помощью опции «запустить текущий открытый скрипт», и он не остановился на точках останова и просто напечатал вывод в«консоль отладки».Что я сделал не так?Мой код:
<?php
$c = 0;
for ($i=0; $i < 4; $i++) {
$c++;
}
echo $c;
Я ставлю контрольные точки на инициализацию переменной и на тело цикла.Мои php.ini XDebug настройки:
zend_extension="d:/wamp64/bin/php/php7.2.4/zend_ext/php_xdebug-2.6.0-7.2-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back=1
xdebug.stopOnEntry = true
xdebug.remote_log ="D:/wamp64/xdebug.log"
xdebug.remote_port = 9090
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
;xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="D:/wamp64/tmp"
xdebug.show_local_vars=0
Журналы XDebug:
<- launchResponse
Response {
seq: 0,
type: 'response',
request_seq: 2,
command: 'launch',
success: true }
<- outputEvent
OutputEvent {
seq: 0,
type: 'event',
event: 'output',
body: { category: 'stdout', output: '4' } }
4
<- terminatedEvent
TerminatedEvent { seq: 0, type: 'event', event: 'terminated' }
-> disconnectRequest
{ command: 'disconnect',
arguments: { restart: false },
type: 'request',
seq: 3 }
<- disconnectResponse
Response {
seq: 0,
type: 'response',
request_seq: 3,
command: 'disconnect',
success: true }
Visual Studio Code 1.25.1PHP 7.2.4XDebug 2.6.0