简体   繁体   English

VS Code PHP 调试没有 xdebug.remote_autostart=1

[英]VS Code PHP Debugging without xdebug.remote_autostart=1

How can I use the PHP debugger withing VS Code without the following setting in PHP.INI?在 PHP.INI 中没有以下设置的情况下,如何使用带有 VS 代码的 PHP 调试器?

xdebug.remote_autostart=1

This setting makes apache extremely slow.此设置使 apache 极其缓慢。

Before I used PHPStorm and this supplied a parameter un the URL that triggered the debugger.在我使用 PHPStorm 之前,它提供了一个触发调试器的参数 un URL。 I wonder if this is possible in VS Code too.我想知道这是否也可以在 VS Code 中实现。

I use VS Code 1.53.2 with the PHP extension pck from Felix Becker.我将 VS Code 1.53.2 与 Felix Becker 的 PHP 扩展 pck 一起使用。

Before someone asks: I switched to VS code although I loved PHPStorm because PHPStorm is unusable on my Surface pro X due to bad performance.在有人问之前:尽管我喜欢 PHPStorm,但我切换到了 VS 代码,因为 PHPStorm 由于性能不佳而无法在我的 Surface pro X 上使用。 VS Code has a Windows Arm implementation! VS Code 有一个 Windows Arm 实现!

Use xdebug v3 instead of v2:使用 xdebug v3 而不是 v2:

For Xdebug v3.xx:对于 Xdebug v3.xx:

[xdebug]
zend_extension = //path to xdebug dll file
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

In xdebug v3 you can use xdebug.start_with_request = yes instead of xdebug.remote_autostart = 1在 xdebug v3 中,您可以使用xdebug.start_with_request = yes而不是xdebug.remote_autostart = 1

make a simple test.php file, put a phpinfo();做一个简单的test.php文件,放一个phpinfo(); statement in there, then copy the output and paste it into the Xdebug installation wizard .在那里声明,然后复制 output 并将其粘贴到Xdebug 安装向导中。 It will analyze it and give you tailored installation instructions for your environment.它将对其进行分析并为您提供适合您环境的安装说明。

If you are using "PHP Debug" extension by "Felix Becker" in "VS Code" you will see more instructions at extension's details.如果您在“VS Code”中使用“Felix Becker”的“PHP Debug”扩展,您将在扩展的详细信息中看到更多说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM