![phpstorm debugger phpstorm debugger](https://linuxx.info/wp-content/uploads/2021/04/nastrojka-xdebug-v-phpstorm-9da5b28.png)
You can make breakpoints conditional to only pause on specific cases. You should see the window with variables, and actions for debugging (e.g., terminate, run, step into, step over, resume program, stop). Reload the page, and the script execution should stop before the breakpoint.
PHPSTORM DEBUGGER CODE
Then open the file you want to debug, add a breakpoint on the line of the code to pause execution on (click on a line number in a gutter). Configure the main project directory (on host) to point to the directory on the remote machine (use pwd in Vagrant terminal to find it). Accept to create a new server configuration.įrom PhpStorm preferences ( ⌘,) go to Languages & Frameworks | PHP | Servers, select the newly created server. For easier access you might want to set a keyboard shortcut which executes both commands (e.g., ⌥⇧D).Īfter loading the page (with debug session turned on) if debugging is not configured PhpStorm will throw a prompt with auto-configuration values. After you finished debugging use Run | Stop listening for PHP Debug Connections command to stop debugging session. Use Run | Start listening for PHP Debug Connections command from the menu to start the debugging session. Create (or select) the remote interpreter based on Vagrant. To stop the debugging session you need to use XDEBUG_SESSION_STOP URL parameter, or to delete the cookie.įrom PhpStorm preferences ( ⌘,) go to Languages & Frameworks | PHP. If you don't want to use the browser add-on, you will need to set XDEBUG_SESSION_START=session_name as: URL parameter, POST parameter, or cookie. After enabling load the page you want to debug. Use FireFox add-on, or Chrome extension to enable the debug session of a web page.
PHPSTORM DEBUGGER HOW TO
If you don't want to use Homestead check the documentation of Xdebug for options on how to install it. If you're not using Homestead check the article on how to get started with it.
![phpstorm debugger phpstorm debugger](http://popovserhii.com/wp-content/uploads/2019/05/зображення-3.png)
Laravel Homestead ships with Xdebug installed, and configured.
![phpstorm debugger phpstorm debugger](https://content.antistatique.net/app/uploads/2020/12/phpstorm-xdebug-config.png)
This GitHub repository is used in this article. Depending on your OS, or tools used you might need to make small changes to make this work. Keep in mind this article is based on OSX, PhpStorm ( get started guide), Laravel Homestead for development environment. Sooner, or later you will run into a situation where "proper" debug tools are required to find out how your code is executing. The simple var_dump() function can take you a long way in debugging if you need sometimes to check the value of the variable.