{"id":148,"date":"2012-09-18T02:11:32","date_gmt":"2012-09-18T02:11:32","guid":{"rendered":"http:\/\/jsndev.net\/?p=148"},"modified":"2012-09-18T02:11:32","modified_gmt":"2012-09-18T02:11:32","slug":"xdebug-breakpoints-not-working-mamp-phpstorm","status":"publish","type":"post","link":"https:\/\/2022.jasonrikard.com\/?p=148","title":{"rendered":"Xdebug breakpoints not working MAMP, PHPStorm"},"content":{"rendered":"<p>I had an issue with Xdebug not stopping at breakpoints except for the first line of code in only one of my local PHP projects. \u00a0Strangely enough xdebug_break() still worked everywhere I put it. \u00a0My first thought was that a PHPStorm project setting with the debugger was awry. After searching and trying many different php.ini settings someone suggested checking the xdebug logs for\u00a0anomalies.<\/p>\n<p>In your php.in file specify a Xdebug log path file and then restart apache.<\/p>\n<ul>\n<li>xdebug.remote_log=\/[path to where you want the log to live]\/xdebug.log<\/li>\n<\/ul>\n<p>After setting a breakpoint on line 7, running the script, checking the log, and seeing that my breakpoint was being registered, the only\u00a0inconsistency\u00a0I saw was the case in the file path.<\/p>\n<blockquote><p>&lt;- breakpoint_set -i 10 -t line -f file:\/\/\/Users\/na\/PhpstormProjects\/<strong>Sample<\/strong>\/httpdocs\/index.php -n 7<br \/>\n-&gt; &lt;response xmlns=&#8221;urn:debugger_protocol_v1&#8243; xmlns:xdebug=&#8221;http:\/\/xdebug.org\/dbgp\/xdebug&#8221; command=&#8221;breakpoint_set&#8221; transaction_id=&#8221;10&#8243; id=&#8221;429140001&#8243;&gt;&lt;\/response&gt;<\/p>\n<p>&lt;- stack_get -i 11<br \/>\n-&gt; &lt;response xmlns=&#8221;urn:debugger_protocol_v1&#8243; xmlns:xdebug=&#8221;http:\/\/xdebug.org\/dbgp\/xdebug&#8221; command=&#8221;stack_get&#8221; transaction_id=&#8221;11&#8243;&gt;&lt;stack where=&#8221;{main}&#8221; level=&#8221;0&#8243; type=&#8221;file&#8221; filename=&#8221;file:\/\/\/Users\/na\/PhpstormProjects\/<strong>sample<\/strong>\/httpdocs\/index.php&#8221; lineno=&#8221;4&#8243;&gt;&lt;\/stack&gt;&lt;\/response&gt;<\/p><\/blockquote>\n<p>Turns out this particular project folder name was capitalized and others were not. \u00a0This was probably a project path setting within PHPStorm somewhere; however, I changed the folder to be all lowercase in the finder and Xdebug began working perfectly.<\/p>\n<p>So if you can&#8217;t get a breakpoint to work, check the Xdebug logs and your project path names. \u00a0Hopefully this saves you from a few hours of frustration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had an issue with Xdebug not stopping at breakpoints except for the first line of code in only one of my local PHP projects. \u00a0Strangely enough xdebug_break() still worked everywhere I put it. \u00a0My first thought was that a PHPStorm project setting with the debugger was awry. After searching and trying many different php.ini [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[11,26],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-development","tag-development-2","tag-xdebug"],"_links":{"self":[{"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":0,"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2022.jasonrikard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}