{"id":474,"date":"2010-07-12T15:13:16","date_gmt":"2010-07-12T15:13:16","guid":{"rendered":""},"modified":"2010-07-12T15:13:16","modified_gmt":"2010-07-12T15:13:16","slug":"474","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=474","title":{"rendered":"Eclipse\/PDT xdebug \u8c03\u8bd5PHP"},"content":{"rendered":"<p>\u8f6f\u4ef6\uff1a<\/p>\n<p>\u3000\u3000XAMPP 1.6.6 \u89e3\u538b\u7f29\u7248\uff0c<br \/>\u3000\u3000PDT 1.0.2 Release All-in-One\uff0c<br \/>\u3000\u3000XDebug 2.0.2 | Windows modules PHP 5.2.1-5.2.7\uff0c<\/p>\n<p>\u3000\u3000\u6ce8\u610fxdebug\u7684\u7248\u672c\u5fc5\u987b\u548cXAMPP\u4e2d\u7684PHP\u7248\u672c\u517c\u5bb9\uff0cXAMPP 1.6.6\u4e2dPHP\u7248\u672c\u662f5.2.5\uff0c\u6240\u4ee5\u4f7f\u7528XDebug 2.0.2 | Windows modules PHP 5.2.1-5.2.7<\/p>\n<p>\u3000\u3000\u5b89\u88c5\uff1a<\/p>\n<p>\u3000\u3000\u5b89\u88c5XAMPP<\/p>\n<p>\u3000\u3000\u89e3\u538b\u7f29XAMPP\uff0c\u8fd0\u884c\u6839\u76ee\u5f55\u4e0b\u7684setup_xampp.bat\u8fdb\u884c\u5b89\u88c5<\/p>\n<p>\u3000\u3000\u8fd0\u884cxampp_start.exe\u542f\u52a8\u670d\u52a1\u5668\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 <a href=\"http:\/\/localhost\" target=\"_blank\" rel=\"external\">http:\/\/localhost<\/a> \u8fdb\u884c\u6d4b\u8bd5<\/p>\n<p>\u3000\u3000\u8fd0\u884cxampp_stop.exe\u5173\u95ed\u670d\u52a1\u5668<\/p>\n<p>\u3000\u3000\u5b89\u88c5XDebug<\/p>\n<p>\u3000\u3000\u5c06\u4e0b\u8f7d\u7684php_xdebug-2.0.2-5.2.5.dll\u6539\u540d\u4e3aphp_xdebug.dll\uff0c\u590d\u5236\u5230xamppphpext\u76ee\u5f55\u4e0b<\/p>\n<p>\u3000\u3000\u4fee\u6539xamppapachebinphp.ini\u6587\u4ef6\uff0c\u67e5\u627e[Zend]\u4ee3\u7801\u6bb5\uff0c\u5c06\u6b64\u4ee3\u7801\u6bb5\u4e0b\u5168\u90e8\u7528\u201c;\u201d\u6ce8\u91ca\u6389\uff0c\u67e5\u627e[XDebug]\u4ee3\u7801\u6bb5\uff0c\u5c06zend_extension_ts\uff0cxdebug.remote_enable\uff0cxdebug.remote_host\uff0cxdebug.remote_port\uff0cxdebug.remote_handler\u524d\u9762\u7684\u201c;\u201d\u6ce8\u91ca\u7b26\u53bb\u6389<\/p>\n<p>\u3000\u3000\u8fd0\u884cxampp_start.exe\u542f\u52a8\u670d\u52a1\u5668\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 <a href=\"http:\/\/localhost\" target=\"_blank\" rel=\"external\">http:\/\/localhost<\/a>\/xampp\/phpinfo.php\uff0c\u67e5\u627e\u5b57\u7b26\u4e32Xdebug\uff0c\u5982\u679c\u80fd\u67e5\u627e\u5230\uff0c\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p>\u3000\u3000\u4e3a\u4ec0\u4e48\u8981\u6ce8\u91ca\u6389[Zend]\u4ee3\u7801\u6bb5\uff1f\u56e0\u4e3aZend Optimizer\u548cXdebug 2.0.2\u4e0d\u517c\u5bb9\uff0c\u4f1a\u5bfc\u81f4XAMPP\u542f\u52a8\u5931\u8d25\u3002<\/p>\n<p>\u3000\u3000\u5b89\u88c5PDT<\/p>\n<p>\u3000\u3000\u89e3\u538b\u7f29pdt-all-in-one-R20080103-win32.zip\uff0c\u8fd0\u884ceclipse.exe\u542f\u52a8PDT\uff08\u6ce8\u610f\uff1a\u56e0\u4e3aeclipse\u662fjava\u5199\u7684\uff0c\u6240\u4ee5\u9700\u8981\u5148\u5b89\u88c5JRE\uff09<\/p>\n<p>\u3000\u3000\u914d\u7f6eXDebug\u5728PDT\u4e2d\u4f7f\u7528\uff0c\u65b0\u5efa\u4e00debug.php\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<br \/><code><br \/>\u3000\u3000&lt;?php \u3000<br \/>\u3000\u3000functionadd($a,$b){ \u3000<br \/>\u3000\u3000$result=$a+$b; \u3000<br \/>\u3000\u3000return$result; \u3000<br \/>\u3000\u3000} \u3000<br \/>\u3000\u3000echoadd(4,5); \u3000<br \/>\u3000\u3000?&gt;\u3000<br \/><\/code><br \/>\u3000\u3000\u5728PDT\u7f16\u8f91\u4e2d\u7b2c4\u884c$result\u5904\u6253\u4e00\u4e2a\u65ad\u70b9\uff08\u53cc\u51fb\u884c\u53f7\u5de6\u4fa7\u7a7a\u767d\u533a\u57df\uff09\uff0c\u5982\u56fe\uff1a<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/l201071215537.png\" \/><br \/>\u83dc\u5355\u680f\u201cRun &#8211; Open Debug Dialog\u201d\uff0c\u5728\u5de6\u4fa7PHP Web Page\u4e0b\u65b0\u5efa\u4e00\u4e2a\u542f\u52a8\u914d\u7f6e\uff0cServer Debugger\u8bbe\u7f6e\u4e3aXDebug\uff0cFile\u4e2d\u8bbe\u7f6e\u4e3a\u521a\u624d\u65b0\u5efa\u7684debug.php\u6587\u4ef6\uff0cBreak at First Line\u4e0d\u7528\u52fe\u9009\uff0cURL\u5904\u5982\u679c\u4e0d\u6b63\u786e\uff0c\u624b\u5de5\u8bbe\u7f6e\u4e3a\u6b63\u786e\u8def\u5f84\u3002\u70b9\u51fb&#8221;Apply&#8221;\u4fdd\u5b58\u914d\u7f6e\u3002\u5982\u56fe\uff1a<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/8201071215552.png\" \/><br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/0201071215624.png\" \/><br \/>\u5728\u5de5\u5177\u680f\u4e0a\u6253\u5f00debug\u6309\u94ae\uff0c\u5728\u4e0b\u62c9\u9009\u9879\u4e2d\u9009\u62e9XDebug\uff0c\u8fd9\u65f6\u4f1a\u5f39\u51fa\u662f\u5426\u5207\u6362\u5230debug\u900f\u89c6\u56fe\u7684\u5bf9\u8bdd\u6846\uff0c\u9009\u62e9&#8221;Yes&#8221;\u8fdb\u884c\u5207\u6362\u3002<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/k201071215639.png\" \/><br \/>\u8fd9\u65f6\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u8fdb\u5165\u4e86\u8c03\u8bd5\u72b6\u6001\uff0cVariables\u4e2d\u53ef\u4ee5\u770b\u5230$_POST\uff0c$_GET\uff0c\u53d8\u91cf$a\uff0c$b\u7b49\u7684\u503c\u3002<\/p>\n<p>\u3000\u3000\u63a5\u4e0b\u6765\u8fdb\u884c\u5355\u6b65\u8c03\u8bd5\u5427\uff0c\u770b\u770bVariables\u5904\u503c\u7684\u53d8\u5316<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/u20107121574.png\" \/><br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1007\/z201071215710.png\" \/><br \/>\u5176\u5b83<\/p>\n<p>\u3000\u3000\u65b0\u5efa\u4e00\u4e2a\u5982\u4e0a\u6240\u8ff0\u7684debug.php\u6587\u4ef6\u662f\u6bd4\u8f83\u65b9\u4fbf\u7684\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\u6211\u4eec\u8981\u8c03\u8bd5\u7684\u9875\u9762\u5f88\u591a\uff0c\u4e0d\u53ef\u80fd\u53bb\u4e00\u4e2a\u9875\u9762\u4e00\u4e2a\u9875\u9762\u914d\u7f6exdebug\uff0c\u6bcf\u6b21\u8981\u8c03\u8bd5\u65f6\uff0c\u5c31\u8c03\u8bd5\u4e00\u6b21\u4e0a\u9762\u6587\u4ef6\uff0c\u4e0d\u8981\u70b9\u7ea2\u8272\u65b9\u5757\u6309\u94ae\u4e2d\u65ad\u8c03\u8bd5\u529f\u80fd\uff0c\u7136\u540e\u5728\u4f60\u60f3\u8981\u8c03\u8bd5\u7684\u4ee3\u7801\u884c\u524d\u52a0\u4e00\u4e2a\u65ad\u70b9\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u6b63\u5e38\u8fd0\u884c\uff0c\u8fd0\u884c\u5230\u521a\u624d\u6240\u6253\u7684\u65ad\u70b9\u65f6\uff0c\u4f1a\u81ea\u52a8\u518d\u6b21\u8fdb\u5165\u8c03\u8bd5\u72b6\u6001\u3002\u8fd9\u6837\u5c31\u65b9\u4fbf\u591a\u4e86\u3002<\/p>\n<p>\u8f6f\u4ef6\u4e0b\u8f7d\uff1a<br \/>XAMPP Windows 1.7.3<br \/><a href=\"http:\/\/www.apachefriends.org\/download.php?xampp-win32-1.7.3.exe\" target=\"_blank\" rel=\"external\">http:\/\/www.apachefriends.org\/download.php?xampp-win32-1.7.3.exe<\/a><\/p>\n<p>PHP Development Tools<br \/><a href=\"http:\/\/www.eclipse.org\/pdt\/downloads\/\" target=\"_blank\" rel=\"external\">http:\/\/www.eclipse.org\/pdt\/downloads\/<\/a><\/p>\n<p>Xdebug 2.1.0&nbsp;&nbsp;\u9009\u62e9\u5176\u4e00\u4e0b\u8f7d\u5373\u53ef<br \/><a href=\"http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.2-vc6.dll\" target=\"_blank\" rel=\"external\">http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.2-vc6.dll<\/a><br \/><a href=\"http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.3-vc6.dll\" target=\"_blank\" rel=\"external\">http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.3-vc6.dll<\/a><br \/><a href=\"http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.3-vc9.dll\" target=\"_blank\" rel=\"external\">http:\/\/www.xdebug.org\/files\/php_xdebug-2.1.0-5.3-vc9.dll<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6f\u4ef6\uff1a \u3000\u3000XAMPP 1.6.6 \u89e3\u538b\u7f29\u7248\uff0c\u3000\u3000PDT 1.0.2&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-474","post","type-post","status-publish","format-standard","hentry","category-Php"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=474"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/474\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}