Home>Article>PHP Framework> How to configure xdebug for debugging in Homestead (PhpStorm)

How to configure xdebug for debugging in Homestead (PhpStorm)

青灯夜游
青灯夜游 forward
2021-12-24 11:10:41 1904browse

How to configure PhpStorm Xdebug for debugging in the Homestead environment. This article will introduce to you how to configure How to configure xdebug for debugging in Homestead (PhpStorm) in PhpStorm Homestead. I hope it will be helpful to you!

How to configure xdebug for debugging in Homestead (PhpStorm)

Environment

  • windows10
  • PhpStorm v2019.1.3
  • homestead v7.2 (ubuntu18.04 )
  • laravel 5.8.* (vhost: laravel.test)
  • Please configure it according to your actual environment. It doesn’t have to be the same as in my article, but the configuration process is generally similar.. .

Tips

  • Remember that PhpStorm requiresPhpStorm v2019.1.3. Do you need to add
  • when accessing the above
  • ? How to configure xdebug for debugging in Homestead (PhpStorm)_session_start=vagrant, thisvagrantis not fixed, it is best to usephpinfoto see

Configuring the PHP version

File => settings => languages & Frameworks => PHP

If your PHP version cannot be selected at this time, please see the tips at the end of this article

How to configure How to configure xdebug for debugging in Homestead (PhpStorm) for debugging in Homestead (PhpStorm)

选择 CLI Interpreter

How to configure How to configure xdebug for debugging in Homestead (PhpStorm) for debugging in Homestead (PhpStorm)

How to configure How to configure xdebug for debugging in Homestead (PhpStorm) for debugging in Homestead (PhpStorm)

##Configure project directory mapping

    Local Path: is the directory on the windows host
  • Remote Path: is the directory in homestead

  • folder mapping
Configure How to configure xdebug for debugging in Homestead (PhpStorm)

How to configure xdebug for debugging in Homestead (PhpStorm)
How to configure xdebug for debugging in Homestead (PhpStorm) mapping

Breakpoint test

How to configure xdebug for debugging in Homestead (PhpStorm)

How to configure xdebug for debugging in Homestead (PhpStorm)##Notes:

Be sure to enable debug monitoring
  • Be sure to add the parameter
  • ?XDEBUG_SESSION_START=vagrant
  • after the browser. If you don’t want to add this thing every time, you can also install the chrome plug-in
  • ?XDEBUG_SESSION_START=vagrant
  • Thisvagrantis not fixed, it is the value of theIdeKeyset in php.ini
  • Final effect:

How to configure xdebug for debugging in Homestead (PhpStorm)

Tips

If your
    PHP language level
  • cannot be selected , you can try the following settings
    How to configure xdebug for debugging in Homestead (PhpStorm)
Related recommendations:
The latest five Laravel video tutorials

The above is the detailed content of How to configure xdebug for debugging in Homestead (PhpStorm). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete