![]() Visit /node on your local instance of the site and, in your browser of choice, enable Xdebug by clicking on the small bug icon in the address bar (Chrome) or status bar (Firefox).Open modules/node/node.module and add a breakpoint just below the opening function declaration for node_build_content by clicking the blank gutter space to the right of the line number.Open up your project in PHP Storm and select Run > Start Listen for PHP Debug Connections.Setting breakpoints and listening for connections in PHP Storm Manually: You can force Xdebug to start a debugging session by appending the query string ?XDEBUG_SESSION_START=1 to any page url.Xdebug browser plugins set a cookie that Xdebug responds to triggering a debug session to open. Get a helper extension for your browser of choiceīefore you start debugging you'll need to download an Xdebug plugin for your browser of choice. ![]() There's documentation on how to install Xdebug on xAMP stacks at for those Save the file (CMD+S), close the file and click Stop and then Start in MAMP Pro to restart the server and refresh the settings.Add the line xdebug.remote_enable=1 below the line you just uncommented.Zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so" You should now have a line which looks like Uncomment the line just below by removing the preceding semicolon.Search the ini file for the word xdebug.Open MAMP Pro and, in the menu bar, select File > Edit Template > PHP >.If you don't feel like forking out the cash for PHP Storm Netbeans, Eclipse and Sublime's xdebug_client all support Xdebug as well. To using Xdebug to debug code using PHP Storm as my IDE of choice. kpr() is particularly useful when debugging fatal errors that prevent the page from loading far enough to display messages in the message area.Įver since I contracted for Business Spectator I've been addicted Kpr() works similarly to dpm() however it doesn't accept a second argument for labelling and, instead of waiting for for the page to load and displaying the debug in the messages section of your site template, kpr prints the krumo debug widget the second it'sĬalled. Remember to undo all your changes to node.module after you have finished debugging.You can drill down and inspect array and object values simply by clicking around. You should now see an orange debug widget in the messages section of the site.Save node.module and visit a page which contains a node.Some complex classes won't return detailed information. You can safely inspect any PHP variable however This broken tag caused an error in Chrome, as the server was returning a resource of type text/html and not an image, and the Javascript problem was caused by calling the JQuery Dialog method $('#popupDialog').When calling dpm() the first argument is the variable you'd like to inspect and the second is a label describing to you what it is you're inspecting to help when debugging multiple elements on the same page load. I had two problems: a fatal error in a custom javascript file, and an empty site logo definition in my theme which resulted in Drupal printing the logo as. ![]() I eventually determined that the problem was with syntax errors on my site, which I noticed while printing other debugging information to the console. But I eventually figured out it, and here's how to fix it! This small but incredibly annoying problem drove me crazy, and I couldn't immediately find a solution mentioned in the issue queues or elsewhere online. When I called dpm() my debugging messages didn't show up, and when I enabled the devel themer module the "Themer info" popup wasn't appearing on any page. I recently had a problem with both devel and devel themer: neither were printing any messages to the page.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |