我已经从我的Thinkpad笔记本电脑转移到惠普Elitebook。我必须在我的新笔记本电脑中设置我的开发环境。在Windows 10 Pro 64位版本中设置了我的Visual代码和XAMPP之后,我无法调试我的PHP代码。
我已经正确安装了Visual代码的Xdebug扩展,并确保php.ini正确。这是我为php.ini
设置的(我使用了放在E:
驱动器上的便携式XAMPP ):
zend_extension = "E:\xampp\php\ext\php_xdebug-2.4.1-5.4-vc9.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_log="E:\xampp\apache\logs\xdebug.log"
我的xdebug.log显示的信息如下:
Log opened at 2018-10-27 05:56:45
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:///E:/xampp/htdocs/absen/index.php" language="PHP" xdebug:language_version="5.4.3-dev" protocol_version="1.0" appid="7112" idekey="william"><engine version="2.4.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-10-27 05:56:45
但是我的Visual代码不会在断点停止。
我已经重新安装了Visual代码XAMPP,并使用了另一个Xdebug版本,但它仍然无法工作。
我有以下几个链接:
这些解决方案都不起作用。
发布于 2021-02-01 13:40:28
这就是我解决了同样的问题,如果以前的答案没有帮助的话,值得一试。
php.ini
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-3.0.2-8.0-vs16-x86_64.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.client_host = "127.0.0.1"
xdebug.log = "C:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = VSCODE
launch.json
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"type": "php",
"request": "launch",
"name": "Run using local PHP Interpreter",
"program": "${file}",
"runtimeExecutable": "C:\\xampp\\php\\php.exe"
}
]
https://stackoverflow.com/questions/53021711
复制相似问题