PageSourceSearch

https://www.seagm.tech/assets/js/0011bc0b.8db82006.js

js seagm.tech collected 2026-10-04 19:08:44 UTC 34,166 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmy_seagm_tech_site=self.webpackChunkmy_seagm_tech_site||[]).push([[454],{313:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>h,contentTitle:()=>l,default:()=>x,frontMatter:()=>c,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"tech/php-notes/xdebug-remote-guide","title":"PHP \u5f00\u542f Xdebug \u8c03\u8bd5\u6307\u5357","description":"\u539f\u6587\u5730\u5740 https://www.jianshu.com/p/53a9064cb4e7","source":"@site/docs/tech/php-notes/xdebug-remote-guide.md","sourceDirName":"tech/php-notes","slug":"/tech/php-notes/xdebug-remote-guide","permalink":"/docs/tech/php-notes/xdebug-remote-guide","draft":false,"unlisted":false,"editUrl":"https://gitea.seagm.tech/jihong/my-seagm-tech-site/src/branch/main/docs/tech/php-notes/xdebug-remote-guide.md","tags":[{"inline":true,"label":"phpstorm","permalink":"/docs/tags/phpstorm"},{"inline":true,"label":"xdebug","permalink":"/docs/tags/xdebug"}],"version":"current","frontMatter":{"title":"PHP \u5f00\u542f Xdebug \u8c03\u8bd5\u6307\u5357","tags":["phpstorm","xdebug"]},"sidebar":"techSidebar","previous":{"title":"PHP Xdebug + PhpStorm \u8c03\u8bd5\u8fdc\u7a0b\u670d\u52a1\u5668","permalink":"/docs/tech/php-notes/xdebug-phpstorm"},"next":{"title":"xdebug \u8fdc\u7a0b\u8c03\u8bd5 PhpStorm","permalink":"/docs/tech/php-notes/xdebug-remote-phpstorm"}}');var d=s(4848),r=s(8453);const c={title:"PHP \u5f00\u542f Xdebug \u8c03\u8bd5\u6307\u5357",tags:["phpstorm","xdebug"]},l="PHP \u5f00\u542f Xdebug \u8c03\u8bd5\u6307\u5357",h={},o=[{value:"\u76ee\u5f55",id:"\u76ee\u5f55",level:2},{value:"\u4e00\u3001Xdebug \u8c03\u8bd5\u539f\u7406",id:"\u4e00xdebug-\u8c03\u8bd5\u539f\u7406",level:2},{value:"Xdebug \u8c03\u8bd5\u539f\u7406",id:"xdebug-\u8c03\u8bd5\u539f\u7406",level:3},{value:"<strong>\u8c03\u8bd5\u4e2d\u57fa\u672c\u901a\u4fe1\u8fc7\u7a0b\u8bf4\u660e\uff1a</strong>",id:"\u8c03\u8bd5\u4e2d\u57fa\u672c\u901a\u4fe1\u8fc7\u7a0b\u8bf4\u660e",level:3},{value:"\u4e8c\u3001\u5b89\u88c5\u914d\u7f6eXdebug",id:"\u4e8c\u5b89\u88c5\u914d\u7f6exdebug",level:2},{value:"\u67e5\u770b\u672c\u673a php \u7248\u672c",id:"\u67e5\u770b\u672c\u673a-php-\u7248\u672c",level:3},{value:"\u5b89\u88c5 Xdebug \u6269\u5c55",id:"\u5b89\u88c5-xdebug-\u6269\u5c55",level:3},{value:"\u914d\u7f6e php.ini",id:"\u914d\u7f6e-phpini",level:3},{value:"\u4e09\u3001IDE \u914d\u7f6e",id:"\u4e09ide-\u914d\u7f6e",level:2},{value:"\u914d\u7f6ephpStorm",id:"\u914d\u7f6ephpstorm",level:3},{value:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210 Start Debugger \u4e66\u7b7e",id:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210-start-debugger-\u4e66\u7b7e",level:3},{value:"\u56db\u3001\u5185\u7f51\u8fdc\u7a0b\u8c03\u8bd5",id:"\u56db\u5185\u7f51\u8fdc\u7a0b\u8c03\u8bd5",level:2},{value:"1\uff09\u8c03\u8bd5\u5c40\u57df\u7f51\u5185\u8fdc\u7a0b\u4e3b\u673a",id:"1\u8c03\u8bd5\u5c40\u57df\u7f51\u5185\u8fdc\u7a0b\u4e3b\u673a",level:3},{value:"2\uff09\u8de8\u57df\u8c03\u8bd5",id:"2\u8de8\u57df\u8c03\u8bd5",level:3},{value:"3\uff09php \u811a\u672c\u8c03\u8bd5",id:"3php-\u811a\u672c\u8c03\u8bd5",level:3},{value:"4\uff09\u8c03\u8bd5\u5916\u7f51\u8fdc\u7a0b\u4e3b\u673a",id:"4\u8c03\u8bd5\u5916\u7f51\u8fdc\u7a0b\u4e3b\u673a",level:3}];function t(e){const n={a:"a",blockquote:"blockquote",br:"br",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.header,{children:(0,d.jsx)(n.h1,{id:"php-\u5f00\u542f-xdebug-\u8c03\u8bd5\u6307\u5357",children:"PHP \u5f00\u542f Xdebug \u8c03\u8bd5\u6307\u5357"})}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.p,{children:["\u539f\u6587\u5730\u5740 ",(0,d.jsx)(n.a,{href:"https://www.jianshu.com/p/53a9064cb4e7",children:"https://www.jianshu.com/p/53a9064cb4e7"})]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"PHP \u5f00\u542f xdebug \u8c03\u8bd5"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.p,{children:["Xdebug \u4f5c\u4e3a PHP \u7684\u4ee3\u7801\u8c03\u8bd5\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u8c03\u8bd5\u51fd\u6570\uff0c\u4e5f\u53ef\u5c06\u5176\u914d\u7f6e\u4e3a zend studio\u3001editplus\u3001phpstorm \u7b49 IDE \u7684\u7b2c\u4e09\u65b9\u8c03\u8bd5\u63d2\u4ef6\u3002\u901a\u8fc7\u5f00\u542f Xdebug \u7684\u81ea\u52a8\u8ddf\u8e2a (auto_trace) \u548c\u5206\u6790\u5668\u529f\u80fd\uff0c\u66f4\u53ef\u4ee5\u76f4\u89c2\u5bdf PHP \u6e90\u4ee3\u7801\u7684\u6027\u80fd\u6570\u636e\uff0c\u4ece\u800c\u4f18\u5316 PHP \u4ee3\u7801\u3002",(0,d.jsx)(n.br,{}),"\n","\u4f46\u65e0\u5948 Xdebug \u7684\u5b98\u65b9\u6587\u6863\u7684\u8bed\u8a00\u662f\u82f1\u6587\uff0cPHP \u65b0\u624b\u60f3\u6309\u7167\u5b98\u65b9\u6587\u6863\u628a Xdebug \u914d\u7f6e\u597d\uff0c\u4e5f\u5e76\u975e\u4e00\u4ef6\u5bb9\u6613\u4e4b\u4e8b\u3002\u672c\u6587\u5c31\u662f\u5173\u4e8e PHP \u5982\u4f55\u5f00\u542f xdebug \u8c03\u8bd5\u7684\u4e00\u4efd\u7b80\u5355\u6307\u5357\uff0c\u5e0c\u671b\u8d8a\u6765\u8d8a\u591a\u7684\u4eba\u90fd\u80fd\u7528\u4e0a\u8c03\u8bd5\u5229\u5668 Xdebug\u3002"]}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u76ee\u5f55",children:"\u76ee\u5f55"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.strong,{children:"Xdebug \u8c03\u8bd5\u539f\u7406"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"Xdebug\u8c03\u8bd5\u539f\u7406"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"Xdebug\u901a\u4fe1\u8fc7\u7a0b"})})}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.strong,{children:"\u5b89\u88c5\u914d\u7f6e Xdebug"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u67e5\u7
170b\u672c\u673aphp\u7248\u672c"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u5b89\u88c5Xdebug\u6269\u5c55"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u914d\u7f6ephp.ini"})})}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.strong,{children:"IDE \u914d\u7f6e"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u914d\u7f6ephp-cli"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u914d\u7f6eXdebug\u7aef\u53e3"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u914d\u7f6eIdeKey"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u914d\u7f6eservers\u8def\u5f84\u6620\u5c04"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210Start Debugger\u4e66\u7b7e"})})}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.strong,{children:"\u5f00\u542f\u8c03\u8bd5"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u5728chrome\u4e2d\u70b9\u51fbStart debugger"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u5728PHPSTORM\u4e2d\u70b9\u51fb\u83dc\u5355Run->Start Listening for PHP debug connection"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u6d4f\u89c8\u5668\u8bbf\u95ee\u672c\u5730\u7f51\u7ad9"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u5173\u95ed\u8c03\u8bd5"})})}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.strong,{children:"Xdebug \u8c03\u8bd5\u4e2d\u9047\u5230\u7684\u51e0\u4e2a\u7279\u6b8a\u573a\u666f"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u8c03\u8bd5\u5c40\u57df\u7f51\u5185\u8fdc\u7a0b\u4e3b\u673a"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u8de8\u57df\u8c03\u8bd5"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"php\u811a\u672c\u8c03\u8bd5"})})}),"\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:(0,d.jsx)(n.code,{children:"\u8c03\u8bd5\u5916\u7f51\u8fdc\u7a0b\u4e3b\u673a"})})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u4e00xdebug-\u8c03\u8bd5\u539f\u7406",children:"\u4e00\u3001Xdebug \u8c03\u8bd5\u539f\u7406"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.em,{children:"\u501f\u7528\u5b98\u65b9\u7f51\u7ad9\u56fe\u4e00\u5f20\uff1a"})}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"http://upload-images.jianshu.io/upload_images/5394123-d3a83c3dcaddf614.gif",alt:""})}),"\n",(0,d.jsx)(n.h3,{id:"xdebug-\u8c03\u8bd5\u539f\u7406",children:"Xdebug \u8c03\u8bd5\u539f\u7406"}),"\n",(0,d.jsx)(n.p,{children:"\u53f3\u8fb9\u673a\u5668\uff08IP=10.0.1.2\uff09\u662f\u5e03\u7f72\u4e86 Nginx/php \u7684\u670d\u52a1\u7aef (\u4e0b\u6587\u7b80\u79f0 php \u670d\u52a1\u7aef)\uff0c\u5de6\u4fa7\u673a\u5668\uff08IP=10.0.1.42\uff09\u662f\u5e03\u7f72\u4e86 IDE\uff08\u6bd4\u5982 Phpstorm\uff09\u7684 IDE \u7aef (\u4e0b\u6587\u7b80\u79f0 IDE \u7aef)\u3002"}),"\n",(0,d.jsx)(n.h3,{id:"\u8c03\u8bd5\u4e2d\u57fa\u672c\u901a\u4fe1\u8fc7\u7a0b\u8bf4\u660e",children:(0,d.jsx)(n.strong,{children:"\u8c03\u8bd5\u4e2d\u57fa\u672c\u901a\u4fe1\u8fc7\u7a0b\u8bf4\u660e\uff1a"})}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee web \u9875\u9762\uff0cnginx \u901a\u8fc7 fastcgi \u7f51\u5173\u63a5\u53e3\u52a0\u8f7d PHP \u811a\u672c\u8fd0\u884c (\u5bf9\u5e94\u56fe\u4e0a\u7b2c\u4e00\u4e2a\u671d\u5411\u53f3\u7684\u7bad\u5934)\u3002"}),"\n",(0,d.jsx)(n.li,{children:"\u7136\u540e php \u89e3\u91ca\u5668\uff08\u5f53\u7136\u5fc5\u987b\u5df2\u88c5\u597d Xdebug \u6269\u5c55\uff09\uff0c\u5411 IDE \u7aef\u7684 9000 \u7aef\u53e3\uff08 \u672c\u6587\u4e0b\u9762\u7528\u7684\u90fd\u662f 9001\uff0c\u539f\u56e0\u662f\u6211\u672c\u673a 9000 \u7aef\u53e3\u88ab\u5176\u5b83\u7a0b\u5e8f\u5360\u7528\uff09\u53d1\u8d77\u57fa\u4e8e DBGP \u534f\u8bae\u7684\u8c03\u8bd5\u8bf7\u6c42\u3002"}),"\n",(0,d.jsx)(n.li,{children:"IDE \u7aef\u6536\u5230 DBGP \u534f\u8bae\u8bf7\u6c42\u540e\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u5355\u6b65\u8c03\u8bd5\u4e86\u3002"}),"\n",(0,d.jsx)(n.li,{children:"\u8c03\u8bd5\u5b8c\u6210\u540e\uff0c\u670d\u52a1\u7aef php \u89e3\u91ca\u5668\u6267\u884c\u5b8c\u6bd5\uff0c\u5411\u6d4f\u89c8\u5668\u8fd4\u56de response\u3002"}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u4e8c\u5b89\u88c5\u914d\u7f6exdebug",children:"\u4e8c\u3001\u5b89\u88c5\u914d\u7f6eXdebug"}
1),"\n",(0,d.jsx)(n.h3,{id:"\u67e5\u770b\u672c\u673a-php-\u7248\u672c",children:"\u67e5\u770b\u672c\u673a php \u7248\u672c"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"$: php --version\nPHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS )\nCopyright (c) 1997-2016 The PHP Group\nZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies\n    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans\n    with Zend OPcache v7.0.13-0ubuntu0.16.04.1, Copyright (c) 1999-2016, by Zend Technologies\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u5b89\u88c5-xdebug-\u6269\u5c55",children:"\u5b89\u88c5 Xdebug \u6269\u5c55"}),"\n",(0,d.jsxs)(n.p,{children:["\u53bb\u5b98\u7f51 ",(0,d.jsx)(n.a,{href:"https://xdebug.org/download.php",children:"https://xdebug.org/download.php"})," \u4e0b\u8f7d\u5bf9\u5e94\u7248\u672c\u7684 Xdebug\u3002\u6211\u7684\u64cd\u4f5c\u7cfb\u7edf\u662f ubuntu16.04\uff0c\u6240\u4ee5\u4e0b\u8f7d\u4e86 source \u7248\u672c\u3002",(0,d.jsx)(n.em,{children:(0,d.jsx)(n.a,{href:"https://xdebug.org/files/xdebug-2.6.0beta1.tgz",children:"Xdebug 2.6.0beta1 \u4e0b\u8f7d\u94fe\u63a5"})})]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"cd xdebug-source-directory\nphpize #\u5982\u679c\u6ca1\u6709\uff0c\u8bf7\u5148\u5b89\u88c5Php7.0-dev\u5305\nwhich php-config  #\u67e5\u627ephp-config\u547d\u4ee4\u7684\u4f4d\u7f6e\n./configure \u2013with-php-config=/usr/bin/php-config\nmake\nmake install #\u53ef\u80fd\u9700\u8981\u52a0\u4e0asudo\n#\u5b89\u88c5\u5b8c\u4e86\uff0c\u8981\u8bb0\u4e00\u4e0bxdebug.so\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u4e0b\u9762\u914d\u7f6ephp.ini\u7684\u65f6\u5019\u9700\u8981\n"})}),"\n",(0,d.jsx)(n.h3,{id:"\u914d\u7f6e-phpini",children:"\u914d\u7f6e php.ini"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'[Xdebug]\nzend_extension="/usr/lib/php/20151012/xdebug.so" \nxdebug.remote_enable=1\n#\u4e0eremote_connect_back\u4e0d\u80fd\u540c\u65f6\u5f00\u542f\nxdebug.remote_host="localhost" \nxdebug.remote_port=9001\n #\u4e0eremote_host\u4e0d\u80fd\u540c\u65f6\u5f00\u542f\n;xdebug.remote_connect_back = 1 \nxdebug.remote_handler="dbgp"\nxdebug.idekey=PHPSTORM\n'})}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.em,{children:"\u89e3\u91ca\u4e00\u4e0b:"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"zend_extension"}),"\u6bcf\u4e2a\u4eba\u5b89\u88c5 xdebug \u6269\u5c55\u7684\u4f4d\u7f6e\u53ef\u80fd\u4e0d\u540c\uff0c\u6309\u5b9e\u9645\u60c5\u51b5\u586b\u5199\u3002"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"remote_enable"})," \u5fc5\u987b\u8bbe\u7f6e\u4e3a 1"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"remote_host"}),"\u548c",(0,d.jsx)(n.code,{children:"remote_port"}),"\u5206\u522b\u586b",(0,d.jsx)(n.code,{children:"localhost"}),"\u548c",(0,d.jsx)(n.code,{children:"9001"}),"\u3002",(0,d.jsx)(n.code,{children:"remote"}),"\u662f\u6307",(0,d.jsx)(n.code,{children:"IDE\u7aef"}),"\uff0c\u5e76\u975e",(0,d.jsx)(n.code,{children:"\u6d4f\u89c8\u5668\u7aef"}),"\u6216\u8005",(0,d.jsx)(n.code,{children:"PHP\u670d\u52a1\u7aef"}),"\uff0c\u6ce8\u610f\u7406\u89e3\u6e05\u695a\u3002"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"remote_handler"}),"\u53ea\u80fd\u586b",(0,d.jsx)(n.code,{children:"dbpg"}),"\uff0c\u7167\u586b\u5c31\u884c\u3002"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.code,{children:"idekey"}),"\u662f\u7528\u4e8e\u8fdb\u884c\u4f1a\u8bdd\u8eab\u4efd\u6807\u8bc6\u7684\uff0c\u9700\u8981\u4e0e\u540e\u9762 IDE \u7aef\u586b\u7684\u4fdd\u6301\u4e00\u81f4\uff0c\u8fd9\u91cc\u586b\u7684\u662f",(0,d.jsx)(n.code,{children:"PHPSTORM"}),"\u3002"]}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u4e09ide-\u914d\u7f6e",children:"\u4e09\u3001IDE \u914d\u7f6e"}),"\n",(0,d.jsx)(n.h3,{id:"\u914d\u7f6ephpstorm",children:"\u914d\u7f6ephpStorm"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e php-cli"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-c401ff59a6b27338.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e php-cli"}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:["\u914d\u7f6e xdebug \u7aef\u53e3\uff0c\u6211\u586b\u7684\u662f 9001\uff0c\u4e0e\u524d\u9762 php.ini \u4e2d",(0,d.jsx)(n.code,{children:"xdebug.remote_port"}),"\u4fdd\u6301\u4e00\u81f4\u3002"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-d71d2d7347800819.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e xdebug \u7aef\u53e3"}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsxs)(n.p,{children:["\u914d\u7f6e IdeKey\uff0c\u4e0e\u524d\u9762 php.ini \u4e2d",(0,d.jsx)(n.code,{children:"xdebug.idekey"}),"\u4fdd\u6301\u4e00\u81f4\u3002Host \u548c Port \u4f1a\u81ea\u52a8\u586b\u597d\u3002"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-715d1958ffe7ff77.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e IDEKEY"}),"\n"]}),"\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e servers\uff0c\u8fd9\u4e2a\u4e0b\u9762\u8bb2\u8fdc\u7a0b\u8c03\u8bd5\u7684\u65f6\u5019\u518d\u8bb2\u3002"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-5eafda83d60c1044.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u914d\u7f6e servers"}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210-start-debugger-\u4e66\u7b7e",children:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210 Start Debugger \u4e66\u7b7e"}),"\n",(0,d.jsx)(n.p,{children:"\u4ee5 chrome \u4e3a\u4f8b\u8fdb\u884c\u8bf4\u660e\uff1a"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-5cc7ae7eab2d2526.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u4e3a\u6d4f\u89c8\u5668\u751f\u6210 Start Debugger \u4e66\u7b7e"}),"\n",(0,d.jsxs)(n.p,{children:["\u6253\u5f00",(0,d.jsx)(n.code,{children:"https://www.jetbrains.com/phpstorm/marklets/"}),"\uff0c\u70b9\u51fb\u84dd\u8272\u7684 GENERATE \u6309\u94ae\uff0c\u751f\u6210 Start debugger/Stop debugger/ Debug this page \u4e09\u4e2a\u84dd\u8272\u94fe\u63a5\u540e",(0,d.jsx)(n.br,{}
1),"\n","\u64cd\u4f5c\u9f20\u6807\u62d6\u52a8\u8fd9\u4e09\u4e2a\u94fe\u63a5\u5230 chrome \u7684\u4e66\u7b7e\u680f\u4e0a\u3002"]}),"\n",(0,d.jsx)(n.p,{children:"\u5230\u6b64\u4e3a\u6b62\uff0cXdebug \u5168\u90e8\u5b89\u88c5\u914d\u7f6e\u90fd\u5b8c\u6210\u4e86\u3002"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u70b9\u51fb chrome \u4e66\u7b7e\u4e2d\u7684 Start debugger\u3002\u8fd9\u4e2a\u4e66\u7b7e\u7684\u4f5c\u7528\u5c31\u662f\u7ed9\u9875\u9762\u7684 cookie \u589e\u52a0\u4e00\u9879",(0,d.jsx)(n.code,{children:"XDEBUG_SESSION=PHPSTORM;path=/"}),"\u3002Start Debugger \u4e66\u7b7e\u5b9e\u9645\u4ee3\u7801\u5982\u4e0b\uff1a"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"javascript:(function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()\n"})}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u6253\u5f00 Phpstorm\uff0c\u70b9\u51fb",(0,d.jsx)(n.code,{children:"\u83dc\u5355Run"}),"->",(0,d.jsx)(n.code,{children:"Start Listening for PHP debug connection"})]}),"\n",(0,d.jsx)(n.li,{children:"\u5728\u9700\u8981\u8c03\u8bd5\u4ee3\u7801\u7684\u5730\u65b9\u6253\u4e0a\u65ad\u70b9\u3002"}),"\n",(0,d.jsx)(n.li,{children:"\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u672c\u5730\u7f51\u7ad9\u3002\u8c03\u8bd5\u8d77\u4f5c\u7528\u4e86\uff0c\u6709\u6728\u6709\uff01\uff01\uff1f\uff1f"}),"\n",(0,d.jsxs)(n.li,{children:["\u5982\u679c\u8981\u5173\u95ed\u8c03\u8bd5\uff0c\u5148\u5728 chrome \u4e2d\u70b9\u51fb Stop debugger\uff0c\u7136\u540e\u5728 Phpstorm \u4e2d\u70b9\u51fb",(0,d.jsx)(n.code,{children:"\u83dc\u5355Run"}),"->",(0,d.jsx)(n.code,{children:"Stop Listening for PHP debug connection"}),"\u5373\u53ef\u3002"]}),"\n"]}),"\n",(0,d.jsx)(n.h2,{id:"\u56db\u5185\u7f51\u8fdc\u7a0b\u8c03\u8bd5",children:"\u56db\u3001\u5185\u7f51\u8fdc\u7a0b\u8c03\u8bd5"}),"\n",(0,d.jsx)(n.p,{children:"\u4e0a\u9762\u8bb2\u7684\u90fd\u662f\u4e00\u4e9b\u8f83\u7b80\u5355\u7684\u573a\u666f\uff0c\u4f46\u6709\u65f6\u5019\u6211\u4eec\u4e5f\u4f1a\u9762\u4e34\u66f4\u590d\u6742\u7684\u573a\u666f\uff0c\u6bd4\u5982\u8fdc\u7a0b\u8c03\u8bd5\u3001\u8de8\u57df\u8c03\u8bd5\u3001php \u811a\u672c\u8c03\u8bd5\u7b49\u7b49\u3002\u4e0b\u9762\u5206\u522b\u8bb2\u4e00\u4e0b\u8fd9\u4e9b\u590d\u6742\u573a\u666f\u4e0b\u5982\u4f55\u5f00\u542f xdebug \u8c03\u8bd5\u3002"}),"\n",(0,d.jsx)(n.h3,{id:"1\u8c03\u8bd5\u5c40\u57df\u7f51\u5185\u8fdc\u7a0b\u4e3b\u673a",children:"1\uff09\u8c03\u8bd5\u5c40\u57df\u7f51\u5185\u8fdc\u7a0b\u4e3b\u673a"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsx)(n.p,{children:"\u8c03\u8bd5\u8fdc\u7a0b\u4e3b\u673a\uff0c\u5c31\u662f Php \u670d\u52a1\u7aef\u662f\u8fd0\u884c\u5728\u975e\u672c\u673a\uff0c\u4f46\u662f IDE \u7aef\u662f\u5b89\u88c5\u5728\u6211\u4eec\u672c\u673a\u7684\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u6211\u672c\u673a\uff08IDE \u7aef\uff1a192.168.9.28\uff09\u8981\u8c03\u8bd5\u5bf9\u65b9\u7535\u8111\uff08Php \u670d\u52a1\u7aef\uff1a192.168.10.210\uff09\u4e0a\u7684 PHP \u4ee3\u7801\u3002"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"\u6709\u4e24\u79cd\u5904\u7406\u65b9\u5f0f\uff1a"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.em,{children:"\u65b9\u5f0f\u4e00\uff1a"}),(0,d.jsx)(n.br,{}),"\n","\u4fee\u6539 php \u670d\u52a1\u7aef",(0,d.jsx)(n.code,{children:"192.168.10.210"}),"\u7684 php.ini \u914d\u7f6e\uff0c",(0,d.jsx)(n.code,{children:'xdebug.remote_host="192.168.9.28"'}),"\uff0c\u91cd\u542f php-fpm\u3002\u8fd9\u6837\u8bbe\u7f6e\u7684\u8bdd\uff0c\u53ea\u6709 192.168.9.28 \u7684\u4e0a IDE \u80fd\u5bf9 Php \u670d\u52a1\u7aef\u8fdb\u884c\u8c03\u8bd5\u3002"]}),"\n",(0,d.jsxs)(n.li,{children:[(0,d.jsx)(n.em,{children:"\u65b9\u5f0f\u4e8c\uff1a"}),(0,d.jsx)(n.br,{}),"\n","\u6ce8\u91ca\u6389 php \u670d\u52a1\u7aef",(0,d.jsx)(n.code,{children:"192.168.10.210"}),"\u4e2d php.ini \u7684",(0,d.jsx)(n.code,{children:"xdebug.remote_host"}),"\uff0c\u6dfb\u52a0",(0,d.jsx)(n.code,{children:"remote_connect_back=1"}),"\u914d\u7f6e\uff0c\u91cd\u542f php-fpm\u3002\u8fd9\u6837\u8bbe\u7f6e\u7684\u8bdd\uff0c\u8981\u6c42 IDE \u7aef\u548c\u6d4f\u89c8\u5668\u7aef\u5fc5\u987b\u5728\u540c\u4e00\u53f0\u7535\u8111\u4e0a\u9762\uff0cXdebug \u4f1a\u6839\u636e\u6d4f\u89c8\u5668\u7684 ip \u5730\u5740\u786e\u5b9a IDE \u7aef\u7684 ip \u5730\u5740\uff0c\u6240\u4ee5\u53ef\u4ee5\u652f\u6301\u591a\u53f0\u7535\u8111\u540c\u65f6\u5bf9 Php \u670d\u52a1\u7aef\u8c03\u8bd5\u3002"]}),"\n"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.p,{children:["\u8fdc\u7a0b\u8c03\u8bd5\u7684\u65f6\u5019\uff0c\u7279\u522b\u5730\uff0c\u5982\u679c\u672c\u673a\u7535\u8111\u4ee3\u7801\u8def\u5f84\u4e0e\u8fdc\u7a0b\u4e3b\u673a\u4ee3\u7801\u8def\u5f84\u4e0d\u4e00\u6837\uff0c\u90a3\u4e48\u5fc5\u987b\u914d\u7f6e Servers \u8def\u5f84\u6620\u5c04\uff0c\u65b9\u6cd5\u662f ",(0,d.jsx)(n.code,{children:"phpstorm"}),"->",(0,d.jsx)(n.code,{children:"setting"}),"->",(0,d.jsx)(n.code,{children:"Languages & Frameworks"}),"->",(0,d.jsx)(n.code,{children:"PHP"}),"->",(0,d.jsx)(n.code,{children:"Servers"}),"\u3002\u4e3a\u4e86\u7701\u4e8b\u513f\uff0c\u5176\u5b9e\u53ea\u8981\u914d\u7f6e\u7f51\u7ad9 0.0.0.0 \u7684\u90a3\u4e00\u9879\u5c31\u53ef\u4ee5\u4e86\u3002"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-a4fec1a49d287429.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u8fdc\u7a0b\u8c03\u8bd5 servers mapping"}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"\u5176\u5b83\u64cd\u4f5c\u540c\u4e0a\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002"}),"\n",(0,d.jsx)(n.h3,{id:"2\u8de8\u57df\u8c03\u8bd5",children:"2\uff09\u8de8\u57df\u8c03\u8bd5"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.p,{children:["Xdebug \u5f00\u542f\u8c03\u8bd5\u9700\u8981\u4f9d\u8d56 cookie",(0,d.jsx)(n.code,{children:"XDEBUG_SESSION=PHPSTORM;path=/"}),"\u3002\u4f46\u5728\u8de8\u57df\u8bf7\u6c42\u4e2d\uff0c\u6d4f\u89c8\u5668\u9ed8\u8ba4\u5e76\u4e0d\u4f1a\u4f20\u8f93 cookie\uff0c \u4ece\u800c\u65e0\u6cd5\u5f00\u542f\u8c03\u8bd5\u3002\u89e3\u51b3\u601d\u8def\u4e5f\u7b80\u5355\uff0c\u60f3\u529e\u6cd5\u8ba9\u6d4f\u89c8\u5668\u5728\u8de8\u57df\u8bf7\u6c42\u4e2d\u652f\u6301\u5e26\u4e0a cookie \u5c31\u53ef\u4ee5\u4e86\u3002"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"\u6709\u4e24\u79cd\u5904\u7406\u65b9\u5f0f\uff1a"}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:(0,d.jsx)(n.strong,{children:"\u65b9\u5f0f\u4e00:"})}),"\n"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:['Php \u670d\u52a1\u7aef\u4ee3\u7801\u8bbe\u7f6e\u5141\u8bb8\u8de8\u57df cookie\uff0c\u5e76\u6dfb\u52a0 "Access-Control-Allow-Credentials"="true"',(0,d.jsx)(n.br,{}),"\n","\u4ee5 laravel \u6846\u67b6\u4e3a\u4f8b\uff0c\u5728\u4e2d\u95f4\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801:"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'public function handle($request, Closure $next)\n{\n   return $next($request)\n       ->
1header("Access-Control-Allow-Credentials", "true")  \n       ->header("Access-Control-Allow-Origin", $request->header("Origin"))\n       ->header("Access-Control-Allow-Headers", $request->header("Access-Control-Request->Headers"))\n       ->header("Access-Control-Request-Method", $request->header("Access-Control-Request->Method"));\n}\n'})}),"\n",(0,d.jsxs)(n.p,{children:["\u8bbe\u7f6e\u7684\u5173\u952e\u70b9\u662f",(0,d.jsx)(n.code,{children:"Access-Control-Allow-Credentials"}),"\u5fc5\u987b\u8bbe\u7f6e\u4e3a",(0,d.jsx)(n.code,{children:"true"}),"\uff0c \u4ece\u800c\u5141\u8bb8\u8de8\u57df\u8bf7\u6c42\u65f6\u5e26\u4e0a\u76f8\u5173 cookie\u3002"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u5ba2\u6237\u7aef\u4ee3\u7801\u914d\u7f6e\uff0c",(0,d.jsx)(n.br,{}),"\n","\u4ee5 jQuery.ajax \u4e3a\u4f8b:"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'$.ajax({\n   headers:{\n       "Content-Type":"text/plain",\n   },\n   url:url,\n   type:"POST",\n   data: bodyText,\n   dataType:"json",\n   xhrFields: {\n       withCredentials: true\n   },\n   beforeSend: function(xhr) {\n       document.cookie = "XDEBUG_SESSION=PHPSTORM;domain=localhost;path=/";\n   },\n   async:false,\n   \n   crossDomain: true,\n   success:function(res){\n   },\n   error:function(err){\n   },\n   complete:function(res){\n   },\n\n})\n'})}),"\n",(0,d.jsxs)(n.p,{children:["\u8bbe\u7f6e\u7684\u5173\u952e\u70b9\u662f\u5728",(0,d.jsx)(n.code,{children:"xhrFields"}),"\u4e2d\u589e\u52a0",(0,d.jsx)(n.code,{children:"withCredentials:true"}),"\u548c\u5728",(0,d.jsx)(n.code,{children:"beforeSend"}),"\u51fd\u6570\u4e2d\u589e\u52a0"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'document.cookie = "XDEBUG_SESSION=PHPSTORM;domain=localhost;path=/";\n'})}),"\n",(0,d.jsx)(n.p,{children:"\u8bf4\u660e\u4e00\u70b9\uff1a\u8de8\u57df\u8bf7\u6c42\u5f00\u542f\u8c03\u8bd5\uff0c\u901a\u8fc7 chrome \u4e66\u7b7e\u6216\u8005\u76f4\u63a5\u4fee\u6539\u6d4f\u89c8\u5668 cookie \u7684\u65b9\u5f0f\u5e76\u4e0d\u8d77\u4f5c\u7528\uff0c\u731c\u6d4b\u539f\u56e0\u53ef\u80fd\u662f\u56e0\u4e3a\u6d4f\u89c8\u5668\u672c\u8eab\u7684 cookie \u548c XmlHttpRequest \u4e2d\u7684 cookie \u5e76\u4e0d\u662f\u4e00\u56de\u4e8b\u513f\u3002"}),"\n"]}),"\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"\u65b9\u5f0f\u4e8c"}),"\n"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u501f\u52a9 nginx\uff0c\u5f00\u542f\u8de8\u57df\u8c03\u8bd5 ",(0,d.jsx)(n.code,{children:"(\u5927\u62db\u6765\u5566\uff01)"}),(0,d.jsx)(n.br,{}),"\n","\u73b0\u5728\u5927\u90e8\u5206 Phper \u5f00\u53d1\u7684\u73af\u5883\u90fd\u662f LNMP\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8bf7 nginx \u5e2e\u5fd9\u4fee\u6539 cookie\uff0c\u4ece\u800c\u5c06 cookie \u4f20\u8f93\u5230 php \u670d\u52a1\u7aef\u3002",(0,d.jsx)(n.br,{}),"\n","nginx \u9ed8\u8ba4\u4e0d\u652f\u6301\u4fee\u6539\u8bf7\u6c42\u7684 header \u5b57\u6bb5\uff0c\u6211\u4eec\u9700\u8981\u4e0b\u8f7d\u5b89\u88c5",(0,d.jsx)(n.code,{children:"headers-more-nginx-module"}),"\u6269\u5c55\uff0c\u4e0b\u8f7d\u5730\u5740 ",(0,d.jsx)(n.a,{href:"https://github.com/openresty/headers-more-nginx-module",children:"https://github.com/openresty/headers-more-nginx-module"}),"\u3002",(0,d.jsx)(n.br,{}),"\n","PS\uff1a\u7ed9 nginx \u5b89\u88c5\u6269\u5c55\u4e0d\u518d\u8d58\u8ff0\u4e86\u54e6\u3002\u4e0d\u4f1a\u7684\u8bdd\uff0c\u81ea\u5df1\u767e\u5ea6\u4e0b\u5427\u3002"]}),"\n",(0,d.jsx)(n.li,{children:"\u4fee\u6539 nginx.conf \u865a\u62df\u4e3b\u673a\u914d\u7f6e\uff0c\u5982\u4e0b\u6240\u793a\uff1a"}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'more_set_input_headers  "Cookie:XDEBUG_SESSION=PHPSTORM; $http_cookie";\n'})}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"\u5176\u5b83\u64cd\u4f5c\u540c\u4e0a\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002"}),"\n",(0,d.jsx)(n.h3,{id:"3php-\u811a\u672c\u8c03\u8bd5",children:"3\uff09php \u811a\u672c\u8c03\u8bd5"}),"\n",(0,d.jsx)(n.p,{children:"\u6709\u4e24\u79cd\u5904\u7406\u65b9\u5f0f\uff1a"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u65b9\u5f0f\u4e00\uff1a",(0,d.jsx)(n.br,{}
1),"\n","\u6253\u5f00 Phpstorm\uff0c\u627e\u5230 myscript.php \u6587\u4ef6\uff0c\u70b9\u51fb\u53f3\u952e",(0,d.jsx)(n.code,{children:"Debug 'myscript.php'"}),"\u5373\u53ef\u3002"]}),"\n",(0,d.jsxs)(n.li,{children:["\u65b9\u5f0f\u4e8c\uff1a",(0,d.jsx)(n.br,{}),"\n","\u4fee\u6539\u73af\u5883\u53d8\u91cf\u4e5f\u53ef\u4ee5\u5f00\u542f Xdebug \u8c03\u8bd5"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'export XDEBUG_CONFIG="XDEBUG_SESSION=PHPSTORM"\nphp myscript.php\n'})}),"\n"]}),"\n",(0,d.jsx)(n.h3,{id:"4\u8c03\u8bd5\u5916\u7f51\u8fdc\u7a0b\u4e3b\u673a",children:"4\uff09\u8c03\u8bd5\u5916\u7f51\u8fdc\u7a0b\u4e3b\u673a"}),"\n",(0,d.jsx)(n.p,{children:"\u5206\u4e3a\u5982\u4e0b\u51e0\u6b65\uff1a"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:"\u8bbe\u7f6e\u5185\u7f51\u7a7f\u900f\uff0c\u7528\u7684\u662f\u82b1\u751f\u58f3\uff0c\u6211\u5c06\u82b1\u751f\u58f3\u5206\u914d\u7684\u57df\u540d\u548c\u7aef\u53e3\u6307\u5411\u6211\u672c\u673a IP192.168.9.28 \u548c\u672c\u673a 9001 \u7aef\u53e3\u3002"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-9bad199399910303.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u5185\u7f51\u7a7f\u900f\u7aef\u53e3\u6620\u5c04. png"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.p,{children:["PS\uff1a\u5982\u679c\u89c9\u5f97\u5185\u7f51\u7a7f\u900f\u9ebb\u70e6\u7684\u8bdd\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 ssh \u6765\u5b9e\u73b0\u540c\u6837\u7684\u529f\u80fd\uff0c\u800c\u4e14\u662f\u514d\u8d39\u7684\u3002",(0,d.jsx)(n.br,{}),"\n","\u53c2\u89c1\u6211\u5199\u7684\u53e6\u4e00\u7bc7\u6587\u7ae0",(0,d.jsx)(n.a,{href:"https://www.jianshu.com/p/2d608c48ce73",children:"\u5229\u7528 ssh \u96a7\u9053\uff0c\u8fdb\u884c\u5916\u7f51 php xdebug \u8c03\u8bd5\u548c nodejs \u8c03\u8bd5"})]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"\u4fee\u6539\u8fdc\u7aef\u4e3b\u673a php-fpm \u7684 php.ini \u7684 xdebug \u90e8\u5206\u5982\u4e0b:"}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'[Xdebug]\nzend_extension="/usr/lib/php/20151012/xdebug.so"\nxdebug.remote_enable=1\n#mzxxxxxxxxxxxxxpc.cn\u5c31\u662f\u5185\u7f51\u7a7f\u900f\u6620\u5c04\u4e2d\u63d0\u4f9b\u7684\u57df\u540d\nxdebug.remote_host="mzxxxxxxxxxxxxxpc.cn"  \n#4xxxx2\u5c31\u662f\u5185\u7f51\u7a7f\u900f\u6620\u5c04\u63d0\u4f9b\u7684\u7aef\u53e3\nxdebug.remote_port=4xxxx2  \nxdebug.remote_handler="dbgp"\nxdebug.idekey=PHPSTORM\n'})}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"\u91cd\u542f php-fpm"}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:"service php7.0-fpm restart\n"})}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsx)(n.li,{children:"openresty \u6216\u8005 nginx \u7684 server \u5757\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff0c\u5f00\u542f xdebug session\u3002"}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{children:'more_set_input_headers  "Cookie:XDEBUG_SESSION=PHPSTORM; $http_cookie";\n'})}),"\n",(0,d.jsxs)(n.p,{children:["\u5982\u679c\u4e0d\u613f\u610f\u7528 openresty \u7684\u65b9\u5f0f\uff0c\u90a3\u4e48\u70b9\u51fb\u6d4f\u89c8\u5668\u6807\u7b7e",(0,d.jsx)(n.code,{children:"start-debugger"}),"\u4e5f\u53ef\u5f00\u542f xdebug session"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:"\u672c\u673a IDE \u6dfb\u52a0 serverMapping \u6620\u5c04"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-0c2cf20fdfcf475c.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"serverMapping \u6620\u5c04. png"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\n",(0,d.jsx)(n.p,{children:"\u65b0\u5efa\u4e00\u4e2a\u8fd0\u884c\u8c03\u8bd5 php_webApplication \u7684\u4efb\u52a1"}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-34ea73896fe62514.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"image"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:(0,d.jsx)(n.img,{src:"https://gitbook-media.oss-ap-southeast-1.aliyuncs.com/pics/5394123-c758bc8980afc181.png",alt:""})}),"\n",(0,d.jsx)(n.p,{children:"\u65b0\u5efa php web application.png"}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u6700\u540e\u4e00\u6b65\uff0c\u6253\u4e0a\u65ad\u70b9\uff0c\u70b9\u51fb\u83dc\u5355\u4e0a",(0,d.jsx)(n.code,{children:"RUN"}),"=>",(0,d.jsx)(n.code,{children:"debug xxx web Application"}),"\uff0c\u5c31\u53ef\u4ee5\u5f00\u542f\u8c03\u8bd5\u4e86\u3002"]}),"\n"]}),"\n"]}),"\n",(0,d.jsxs)(n.blockquote,{children:["\n",(0,d.jsxs)(n.ul,{children:["\n",(0,d.jsxs)(n.li,{children:["\u9057\u7559\u95ee\u9898\uff1a\u5916\u7f51\u8fdc\u7a0b\u8c03\u8bd5\uff0c\u5fc5\u987b\u70b9\u51fb\u83dc\u5355\u4e0a\u7684",(0,d.jsx)(n.code,{children:"RUN"}),"=>",(0,d.jsx)(n.code,{children:"debug xxx web Application"}),"\u624d\u80fd\u6b63\u5e38\u8fdb\u884c\u8c03\u8bd5\uff0c\u5176\u5b83\u65b9\u5f0f\u6253\u5f00\u7f51\u7ad9\u7684\u8bdd\uff0c\u8c03\u8bd5\u603b\u662f\u4f1a\u51fa\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\u3002"]}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(n.p,{children:"Xdebug \u5f00\u542f\u8c03\u8bd5\u7684\u914d\u7f6e\u5c31\u8fd9\u4e48\u7b80\u5355\u3002\u3002\u3002"})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(t,{...e})}):t(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>l});var i=s(6540);const d={},r=i.createContext(d);function c(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(d):e.components||d:c(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.