{"id":3052,"date":"2017-07-11T19:06:33","date_gmt":"2017-07-11T10:06:33","guid":{"rendered":"http:\/\/redwing.moo.jp\/cocoa\/?p=3052"},"modified":"2017-07-11T19:06:33","modified_gmt":"2017-07-11T10:06:33","slug":"php-storm-%e3%81%ae-xdebug-%e8%a8%ad%e5%ae%9a%e3%81%a7%e5%9b%b0%e3%81%a3%e3%81%9f%e3%82%89%e7%a2%ba%e8%aa%8d%e3%81%99%e3%82%8b%e7%82%b9","status":"publish","type":"post","link":"https:\/\/redwing.moo.jp\/cocoa\/archives\/3052","title":{"rendered":"PHP Storm \u306e Xdebug \u8a2d\u5b9a\u3067\u56f0\u3063\u305f\u3089\u78ba\u8a8d\u3059\u308b\u70b9"},"content":{"rendered":"<p>\u5148\u65e5\uff0c\u4f55\u5ea6\u3082\u884c\u3063\u3066\u3044\u308b PHP Storm \u306e Xdebug \u8a2d\u5b9a\u304c\u884c\u3048\u305a\uff0c\u5c11\u3057\u8abf\u3079\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<h4>\u25bc \u4f7f\u7528\u3057\u3066\u3044\u308b\u74b0\u5883<\/h4>\n<p>MAMP \u30d0\u30fc\u30b8\u30e7\u30f34.1.1 (492)<br \/>\nPHP Version 7.0.15<br \/>\nPhpStorm Version 2017.1.4<\/p>\n<p>PHP Storm \u306b\u3066\u30c7\u30d0\u30c3\u30b0\u304c\u884c\u3048\u306a\u3044\u5834\u5408\uff0c\u4ee5\u4e0b\u306e\u70b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<pre>\r\n\u30fbPHP Storm \u306b\u3066\u30c7\u30d0\u30c3\u30b0\u306e\u8a2d\u5b9a\u304c\u3055\u308c\u3066\u3044\u308b\u304b\uff1f\r\n\u30fbphp.ini \u306b xdebug \u306e\u8a2d\u5b9a\u304c\u3055\u308c\u3066\u3044\u308b\u304b\uff1f\r\n\u30fbphp.ini \u306e xdebug \u8a2d\u5b9a\u304c\u9069\u5207\u304b\uff1f\r\n\u30fbxdebug \u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u304b\uff1f\r\n<\/pre>\n<p>PHP Storm \u306e\u30c7\u30d0\u30c3\u30b0\u8a2d\u5b9a\u306b\u3064\u3044\u3066\u306f\u305f\u304f\u3055\u3093\u60c5\u5831\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\uff0c\u3042\u307e\u308a\u9593\u9055\u3044\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\uff0c\u3056\u3063\u3068\u4ee5\u4e0b\u306e\u4e8b\u67c4\u3092\u78ba\u8a8d\u3059\u308c\u3070\u3088\u3044\u304b\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<h4>\u25bc PHP Storm \u306e PHP Server\u8a2d\u5b9a<\/h4>\n<p><strong>Preferences > Languages &#038; Frameworks > PHP > Debug <\/strong><br \/>\nxdebug \u306e\u30c7\u30d0\u30c3\u30b0\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<p><strong>Preferences > Languages &#038; Frameworks > PHP > Servers<\/strong><br \/>\nMAMP \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\uff0c\u6b63\u3057\u304f\u30dd\u30fc\u30c8\u756a\u53f7\u306a\u3069\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\uff1f\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<h4>\u25bc PHP Storm \u306e \u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30c3\u30b0\u8a2d\u5b9a<\/h4>\n<p><strong>RUN > Edit Configurations\u2026<\/strong><br \/>\n<strong>Defaults > PHP Remote Debug<\/strong><br \/>\n\u4e00\u5fdc\uff0c\u3053\u3061\u3089\u3082 Preferences \u306e\u8a2d\u5b9a\u304c\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b\uff1f\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<p>\u6b21\u306b php.ini \u306b xdebug \u306e\u8a2d\u5b9a\u304c\u3055\u308c\u3066\u3044\u308b\u304b\uff1f\u78ba\u8a8d\u3057\u307e\u3059\uff0e<br \/>\n\u9069\u7528\u3055\u308c\u3066\u3044\u308b php.ini \u30d5\u30a1\u30a4\u30eb\u306f\u74b0\u5883\u306b\u3088\u308a\u7570\u306a\u308a\u307e\u3059\u306e\u3067\uff0cphpInfo \u306b\u3088\u308a\u78ba\u8a8d\u3057\u307e\u3059\uff0e<br \/>\n\u79c1\u306e\u5834\u5408\uff0cMAMP \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\uff0cMAMP \u306e phpInfo \u3088\u308a\u4ee5\u4e0b\u306e\u9805\u76ee\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\uff0e<\/p>\n<h4>\u25bc phpInfo \u304b\u3089 .ini \u30d5\u30a1\u30a4\u30eb\u3092\u7279\u5b9a\u3059\u308b<\/h4>\n<p>\u300c<strong>Loaded Configuration File<\/strong>\u300d\u9805\u76ee\u306e\u8a2d\u5b9a\u3092\u53c2\u7167\u3059\u308b\uff0e<br \/>\n\/Applications\/MAMP\/bin\/php\/php7.0.15\/conf\/php.ini<\/p>\n<h4>\u25bc xdebug \u8a2d\u5b9a<\/h4>\n<p>\u4e0a\u8a18\u306e .ini \u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\uff0c[xdebug] \u30bb\u30af\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<br \/>\n\u554f\u984c\u304c\u3042\u3063\u305f\u74b0\u5883\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\uff0e<br \/>\n\u4e00\u898b\u554f\u984c\u304c\u306a\u3044\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u304c\uff0c\u300cxdebug.remote_connect_back\u300d\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u3068\u30c7\u30d0\u30c3\u30b0\u304c\u884c\u3048\u306a\u3044\u3053\u3068\u304c\u3042\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<pre>\r\nzend_extension=\"\/Applications\/MAMP\/bin\/php\/php7.0.15\/lib\/php\/extensions\/no-debug-non-zts-20151012\/xdebug.so\"\r\n; zend_extension=\"\/usr\/libexec\/apache2\/xdebug.so\"\r\nxdebug.remote_enable = On\r\nxdebug.remote_handler = dbgp\r\nxdebug.remote_host = localhost\r\nxdebug.remote_port = 9000\r\nxdebug.profiler_enable = 1\r\nxdebug.profiler_output_dir=\"\/var\/tmp\/xdebug\"\r\nxdebug.idekey = \"PHPSTORM\"\r\nxdebug.remote_connect_back = on   \/\/ \u3053\u3053\u304c\u554f\u984c\u3060\u3063\u305f\r\n<\/pre>\n<p>remote_connect_back \u3092\u30aa\u30d5\u306b\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<br \/>\n<strong>\u79c1\u306e\u74b0\u5883\u3067\u306f\uff0c\u3053\u306e\u8a2d\u5b9a\u304c\u30aa\u30f3\u306b\u306a\u3063\u3066\u3044\u305f\u305f\u3081\u30c7\u30d0\u30c3\u30b0\u3067\u304d\u306a\u304b\u3063\u305f\u3088\u3046\u3067\u3059\uff0e<\/strong><\/p>\n<pre>\r\nxdebug.remote_connect_back=0\r\n\u307e\u305f\u306f\r\nxdebug.remote_connect_back=off\r\n<\/pre>\n<p>xdebug.remote_connect_back \u306f\uff0cXdebug 2.1 \u304b\u3089\u8ffd\u52a0\u3055\u308c\u305f\u8a2d\u5b9a\u3067 xdebug.remote_host \u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\uff0c\u3053\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u3068\uff0c\u8907\u6570\u306e\u30ea\u30e2\u30fc\u30c8 \u30d0\u30c3\u30b0\u74b0\u5883\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u3068\u306e\u3053\u3068\uff0e<\/p>\n<h4>\u25bc \u30d6\u30c3\u30af\u30de\u30fc\u30af\u30ec\u30c3\u30c8\u3092\u4f7f\u308f\u305a\u306b\uff0c\u5e38\u306b\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u306b\u306f<\/h4>\n<p>xdebug \u306e\u8a2d\u5b9a\u3067\uff0cidekey \u3092\u8a2d\u5b9a\u3057\u3066\uff0cremote_autostart \u3092\u30aa\u30f3\u306b\u3057\u3066\u304a\u3051\u3070\u3088\u3044\u3088\u3046\u3067\u3059\uff0e<\/p>\n<p>xdebug.remote_autostart=1<\/p>\n<p><strong>\u53c2\u8003\uff1a<\/strong><a href=\"https:\/\/xdebug.org\/docs\/all_settings\" target=\"_blank\">This section describes all available configuration settings available in Xdebug.<\/a><\/p>\n<p>\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u305f\u969b\u306b\u306f\uff0c\u30b5\u30fc\u30d0\u306e\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\uff0e<br \/>\n\u518d\u5ea6\uff0cphpInfo \u3067 xdebug \u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<h4>\u25bc xdebug \u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u304b\uff1f<\/h4>\n<p> \u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u304d\uff0c\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e<\/p>\n<pre>\r\n$ lsof -n -P -i :9000\r\n<\/pre>\n<p>\u74b0\u5883\u306b\u3088\u3063\u3066\u306f\uff0c\u30dd\u30fc\u30c8\u756a\u53f7: 9000 \u3067\u30c7\u30d0\u30c3\u30b0\u3067\u304d\u305a\uff0c9001 \u306a\u3069\u306b\u3055\u308c\u3066\u3044\u308b\u65b9\u3082\u3044\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<p>\u4e0a\u8a18\u306e\u4e8b\u67c4\u304c\u554f\u984c\u306a\u3051\u308c\u3070\uff0c\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u3042\u308b\u300clisten php debug connections\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\uff0e<br \/>\n\u30b9\u30bf\u30fc\u30c8\u3059\u308b\u3068\u30a2\u30a4\u30b3\u30f3\u306e\u4e0a\u90e8\u304c\u7dd1\u8272\u306b\u306a\u308b\u306f\u305a\u3067\u3059\uff0e<\/p>\n<p>\u3067\u306f\uff01<\/p>\n<a href=\"https:\/\/twitter.com\/redwing1300?ref_src=twsrc%5Etfw\" class=\"twitter-follow-button\" data-size=\"large\" data-show-count=\"false\">Follow @redwing1300<\/a><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><div id=\"redwi-4269241506\" class=\"redwi- redwi-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9652476346722993\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-9652476346722993\" \ndata-ad-slot=\"\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u5148\u65e5\uff0c\u4f55\u5ea6\u3082\u884c\u3063\u3066\u3044\u308b PHP Storm \u306e Xdebug \u8a2d\u5b9a\u304c\u884c\u3048\u305a\uff0c\u5c11\u3057\u8abf\u3079\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\uff0e \u25bc \u4f7f\u7528\u3057\u3066\u3044\u308b\u74b0\u5883 MAMP \u30d0\u30fc\u30b8\u30e7\u30f34.1.1 (492) PHP Version 7.0.15 Php &hellip; <a href=\"https:\/\/redwing.moo.jp\/cocoa\/archives\/3052\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[183,97,182],"class_list":["post-3052","post","type-post","status-publish","format-standard","hentry","category-php","tag-mamp","tag-phpstorm","tag-xdebug"],"_links":{"self":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/3052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/comments?post=3052"}],"version-history":[{"count":12,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/3052\/revisions"}],"predecessor-version":[{"id":3064,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/3052\/revisions\/3064"}],"wp:attachment":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/media?parent=3052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/categories?post=3052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/tags?post=3052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}