![]() You can then use your debugger to inspect the available php variables. If all goes well, PHPStorm will listen for the xdebug connection and “catch” the request on the line you added the breakpoint to. Jump back to chrome and navigate to your site’s homepage. Start Listening for Debug Connections: Click the icon on the top that looks like a “old-timey” phone handset with a crossed out red circle at the top and little green bug at the bottom. Add a breakpoint somewhere by clicking in the gutter, to the left of the code, and to the right of the line numbers. Install the chrome xdebug helper extension if you don’t already have it installed.īack in PHPStorm, navigate to your Drupal project index.php file. Let’s test to see that xdebug is running. On the following screen, you can just click “ok”. You may get an RSA warning that you can ignore and click yes. PHPStorm will automatically fill in the remaining settings after which you can just click ok. In my case it’s the box folder for my project. Click on the plus icon, choose “Remote” and then select the “Vagrant” radio button and navigate to the “Vagrant Instance Folder”. Hint: type “CLI Interpreter” in the search field to find this quicker. Click the “…” to the right of the CLI Interpreter field. Open up the PHPStorm Preferences (⌘ + ,) and go to Languages & Frameworks > PHP. ![]() Next, we will need to setup PHP to use the remote interpreter on your VM. The next step is to get PHPStorm setup to listen to xdebug breakpoints.įirst, make sure your VM is running - $ vagrant up. If xdebug is running, you should see a bunch of lines related to xdebug on the screen. In your terminal window, ssh into the Virtual Machine (VM) with: $ vagrant ssh and run $ php -i | grep xdebug. Save config.yml and then open the terminal app, navigate to the same folder that your config.yml file lives in, and run: # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. ![]() XDebug is disabled by default for better performance. One HUGE note, is that you do not want to have Xdebug running on production servers.įor most of the developers attending, your environment may already be setup for you, but if you are anything like me, you may have been pushed into an environment that did not have Xdebug installed.# XDebug configuration. and if there is enough time, how to do it by hand. Some examples may include, using straight DrupalVM, with or without any other helper programs like Bolt. Towards the end there will be a section on how you can setup Xdebug when your development environment has been built outside of Acquia Dev Desktop. I can help you setup PHPStorm for development of Drupal as well as show you how to setup Acquia Dev Desktop to include Xdebug. When the two noted above are combined together you Drupal development and debugging skills will grow to great lengths. It also allows you to change the values of one or more variables on the fly, affecting the execution of your application. Xdebug replaces the need to litter your code with echo, print_r() or var_dump() calls, and displays information on all variables. With it you can set a breakpoint and pause the execution of a script to see the state of your application at that exact point, including what variables/objects have been instantiated and what their values are. It provides debugging and profiling capabilities. Xdebug is a PHP extension that was written and is maintained by Derick Rethans. PhpStorm is a popular IDE growing within the Drupal world, it is utilized by the Acquia development teams and provides native support for Xdebug. The first among a long line of improvements in my development world has been the inclusion of PHPStorm and Xdebug. There have been a few things to help me along my long daunting development process. ![]() If this sounds familiar I am here to let you know that there is hope. So to try to pinpoint what is happening you put 20 print statements in your code hoping that one would show up on you page to let you know where to start your decent into debug land. Have you ever gazed at your screen wondering why your most recent edit is not showing up on the page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |