Phpstorm cooperates with yasd to debug projects in virtual machine

Time:2021-2-25

1. Install yasd

seehttps://github.com/swoole/yasd

two php.ini Introducing yasd configuration in

zend_extension=yasd
yasd.debug_mode=remote
yasd.remote_ Host = 10.50.50.233
yasd.remote_ Port = 5556 # port

3. Phpstorm configures the ports configured above

Fill in the Xdebug debug port in this path: file | settings | Languages & frameworks | PHP | debug with 5556

Phpstorm cooperates with yasd to debug projects in virtual machine

4. Configure path mapping

Add a server in the path of file | settings | Languages & frameworks | PHP | servers

Phpstorm cooperates with yasd to debug projects in virtual machine

5. Open the button to monitor debug

Phpstorm cooperates with yasd to debug projects in virtual machine

6. Make a breakpoint in the editor, and then start the project

Here, take hyperf as an example. Hyperf should pay attention to whether to generate a proxy class, and the breakpoint must be on the proxy class
php -e bin/hyperf.php start

7. Click the play button to resume the program and wait for the project to start

Phpstorm cooperates with yasd to debug projects in virtual machine

8. Enter the corresponding address in the browser to enter debugging

Phpstorm cooperates with yasd to debug projects in virtual machine