简体   繁体   中英

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?

xdebug.remote_autostart=1

This setting makes apache extremely slow.

Before I used PHPStorm and this supplied a parameter un the URL that triggered the debugger. I wonder if this is possible in VS Code too.

I use VS Code 1.53.2 with the PHP extension pck from Felix Becker.

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. VS Code has a Windows Arm implementation!

Use xdebug v3 instead of v2:

For 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

make a simple test.php file, put a phpinfo(); statement in there, then copy the output and paste it into the Xdebug installation wizard . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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