Код Visual Studio не останавливается на точках останова, PHPDebug / XDebug - PullRequest
1 голос
/ 14 марта 2020

Привет, сообщество!

У меня проблема с моей PHP Отладкой при Коде Visual Studio (VS C) , VS C не останавливается на точках останова, установленных в моем сценарии. Я проверил порт 9000. Он открыт, когда я запускаю PHP Debug в моем VS C. Глядя на журнал, кажется, что XDebug работает, но VS C в любом случае не останавливается на точках останова.

На всякий случай, если порт 9000 используется другим приложением, я попытался изменить его на 9001 в php .ini и запуск. json, а затем я перезапустил Apache, чтобы обновить PHP конфигурацию , но VS C во всяком случае, не останавливается на точках останова.

Я пытался установить другую версию расширения PHP Debug , но это не решило мою проблему.

Любые предложения и / или советы приветствуются. Подробности следуют ниже. Переустановка VS C также не принесла мне хороших новостей.

Спасибо!

Вы можете увидеть мою точку останова здесь

Скрипт:

<?php

  $i=0;
  $i=2;

  exit("\$i = $i end at ".date("Y-m-d H:i:s"));

?>

Все установленные на моем ноутбуке вещи:

macOS Catalina 10.15.3
XAMPP 5.6.40 Revision 1 with PHP5.6 and XDebug 2.2.5
Visual Studio Code 1.43.0 with PHP Debug 1.14.0

XDebug настройки php .ini :

zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug.show_local_vars = 1
xdebug.remote_log = /Applications/XAMPP/logs/xdebug.log

PHP Отладка настройки запуск. json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000
    },
    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9000
    }
  ]
}

XDebug logs:

Log opened at 2020-03-14 03:38:14
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/User888/Lab/backoffice/ping.php" language="PHP" protocol_version="1.0" appid="48376" idekey="User888"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- breakpoint_list -i 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

<- breakpoint_set -i 2 -t line -f file:///Users/User888/Lab/BackOffice/ping.php -n 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="483760002"></response>

<- breakpoint_list -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///Users/User888/Lab/BackOffice/ping.php" lineno="4" state="enabled" hit_count="0" hit_value="0" id="483760002"></breakpoint></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///Users/User888/Lab/BackOffice/ping.php" lineno="4" state="enabled" hit_count="0" hit_value="0" id="483760002"></breakpoint></response>

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

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

Log closed at 2020-03-14 03:38:14
...