-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xdebug.html
49 lines (47 loc) · 28.9 KB
/
xdebug.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Xdebug in Docker + PhpStorm | Docker LNMP Docs</title>
<meta name="generator" content="VuePress 1.7.1">
<meta name="description" content="">
<link rel="preload" href="/assets/css/0.styles.4bdbd8d9.css" as="style"><link rel="preload" href="/assets/js/app.81b020fa.js" as="script"><link rel="preload" href="/assets/js/2.8af6cdaa.js" as="script"><link rel="preload" href="/assets/js/102.ff3dbb6b.js" as="script"><link rel="prefetch" href="/assets/js/10.a06e19bf.js"><link rel="prefetch" href="/assets/js/100.cbd02562.js"><link rel="prefetch" href="/assets/js/101.13f67842.js"><link rel="prefetch" href="/assets/js/103.1f8101d7.js"><link rel="prefetch" href="/assets/js/104.d7a55020.js"><link rel="prefetch" href="/assets/js/11.2576d259.js"><link rel="prefetch" href="/assets/js/12.3851802d.js"><link rel="prefetch" href="/assets/js/13.1f65cf63.js"><link rel="prefetch" href="/assets/js/14.4006d695.js"><link rel="prefetch" href="/assets/js/15.973cbd26.js"><link rel="prefetch" href="/assets/js/16.5d970f74.js"><link rel="prefetch" href="/assets/js/17.119a56ba.js"><link rel="prefetch" href="/assets/js/18.83fb132d.js"><link rel="prefetch" href="/assets/js/19.0abaace2.js"><link rel="prefetch" href="/assets/js/20.f265b849.js"><link rel="prefetch" href="/assets/js/21.5d7c3c5a.js"><link rel="prefetch" href="/assets/js/22.b3565840.js"><link rel="prefetch" href="/assets/js/23.7db3fdab.js"><link rel="prefetch" href="/assets/js/24.38aaa400.js"><link rel="prefetch" href="/assets/js/25.4db970f6.js"><link rel="prefetch" href="/assets/js/26.b1e70cac.js"><link rel="prefetch" href="/assets/js/27.ead3fb0f.js"><link rel="prefetch" href="/assets/js/28.0bb8aa83.js"><link rel="prefetch" href="/assets/js/29.225c19d4.js"><link rel="prefetch" href="/assets/js/3.366d4553.js"><link rel="prefetch" href="/assets/js/30.c94a635e.js"><link rel="prefetch" href="/assets/js/31.d098f797.js"><link rel="prefetch" href="/assets/js/32.5799d84d.js"><link rel="prefetch" href="/assets/js/33.d95ed32e.js"><link rel="prefetch" href="/assets/js/34.3159c2d0.js"><link rel="prefetch" href="/assets/js/35.6188f470.js"><link rel="prefetch" href="/assets/js/36.f582c59c.js"><link rel="prefetch" href="/assets/js/37.eb99abce.js"><link rel="prefetch" href="/assets/js/38.c6dac124.js"><link rel="prefetch" href="/assets/js/39.08ed38a8.js"><link rel="prefetch" href="/assets/js/4.6d0e0c17.js"><link rel="prefetch" href="/assets/js/40.cfbd015f.js"><link rel="prefetch" href="/assets/js/41.8e7ea070.js"><link rel="prefetch" href="/assets/js/42.0b0432a6.js"><link rel="prefetch" href="/assets/js/43.f3779543.js"><link rel="prefetch" href="/assets/js/44.f3bc9162.js"><link rel="prefetch" href="/assets/js/45.3ba54d40.js"><link rel="prefetch" href="/assets/js/46.b926d7a0.js"><link rel="prefetch" href="/assets/js/47.18e36cdf.js"><link rel="prefetch" href="/assets/js/48.0dd7d0d3.js"><link rel="prefetch" href="/assets/js/49.99a1ef91.js"><link rel="prefetch" href="/assets/js/5.0b207204.js"><link rel="prefetch" href="/assets/js/50.69b7a23c.js"><link rel="prefetch" href="/assets/js/51.e8864303.js"><link rel="prefetch" href="/assets/js/52.ba0e0d78.js"><link rel="prefetch" href="/assets/js/53.5f699091.js"><link rel="prefetch" href="/assets/js/54.ef1a2910.js"><link rel="prefetch" href="/assets/js/55.5df02059.js"><link rel="prefetch" href="/assets/js/56.d1d16e5b.js"><link rel="prefetch" href="/assets/js/57.b1432479.js"><link rel="prefetch" href="/assets/js/58.d0590f65.js"><link rel="prefetch" href="/assets/js/59.72b039c7.js"><link rel="prefetch" href="/assets/js/6.aa1ab838.js"><link rel="prefetch" href="/assets/js/60.0f0c2b0b.js"><link rel="prefetch" href="/assets/js/61.c2bb1c60.js"><link rel="prefetch" href="/assets/js/62.de3bdba2.js"><link rel="prefetch" href="/assets/js/63.c403851e.js"><link rel="prefetch" href="/assets/js/64.36464d54.js"><link rel="prefetch" href="/assets/js/65.a04e2f16.js"><link rel="prefetch" href="/assets/js/66.61ffcab8.js"><link rel="prefetch" href="/assets/js/67.f2f36dd6.js"><link rel="prefetch" href="/assets/js/68.cf6f913a.js"><link rel="prefetch" href="/assets/js/69.c6136a63.js"><link rel="prefetch" href="/assets/js/7.7f24f1db.js"><link rel="prefetch" href="/assets/js/70.a0938e18.js"><link rel="prefetch" href="/assets/js/71.e7d97e0a.js"><link rel="prefetch" href="/assets/js/72.10aeb9b8.js"><link rel="prefetch" href="/assets/js/73.89b0eb1d.js"><link rel="prefetch" href="/assets/js/74.0ba3c1e1.js"><link rel="prefetch" href="/assets/js/75.8343507b.js"><link rel="prefetch" href="/assets/js/76.e31b6a12.js"><link rel="prefetch" href="/assets/js/77.147a0e3b.js"><link rel="prefetch" href="/assets/js/78.d4db65b8.js"><link rel="prefetch" href="/assets/js/79.ce0122e7.js"><link rel="prefetch" href="/assets/js/8.d4ded85f.js"><link rel="prefetch" href="/assets/js/80.2529f575.js"><link rel="prefetch" href="/assets/js/81.535b9143.js"><link rel="prefetch" href="/assets/js/82.0d0486ef.js"><link rel="prefetch" href="/assets/js/83.7f811dfc.js"><link rel="prefetch" href="/assets/js/84.99cea5fa.js"><link rel="prefetch" href="/assets/js/85.9b33418f.js"><link rel="prefetch" href="/assets/js/86.db7dbe50.js"><link rel="prefetch" href="/assets/js/87.b8dc8765.js"><link rel="prefetch" href="/assets/js/88.9b82bde3.js"><link rel="prefetch" href="/assets/js/89.1ccce7db.js"><link rel="prefetch" href="/assets/js/9.5a581b91.js"><link rel="prefetch" href="/assets/js/90.045c8093.js"><link rel="prefetch" href="/assets/js/91.af0f6d30.js"><link rel="prefetch" href="/assets/js/92.200f45f9.js"><link rel="prefetch" href="/assets/js/93.1ef23d6e.js"><link rel="prefetch" href="/assets/js/94.1a4704da.js"><link rel="prefetch" href="/assets/js/95.e773e71a.js"><link rel="prefetch" href="/assets/js/96.1240c46a.js"><link rel="prefetch" href="/assets/js/97.213ce647.js"><link rel="prefetch" href="/assets/js/98.ad0f473a.js"><link rel="prefetch" href="/assets/js/99.33575578.js">
<link rel="stylesheet" href="/assets/css/0.styles.4bdbd8d9.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">Docker LNMP Docs</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
使用指引
</a></div><div class="nav-item"><a href="/ee/" class="nav-link">
商业版
</a></div><div class="nav-item"><a href="https://github.com/khs1994-docker/lnmp" target="_blank" rel="noopener noreferrer" class="nav-link external">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://zan.khs1994.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
捐赠
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console" target="_blank" rel="noopener noreferrer" class="nav-link external">
腾讯云服务器限时秒杀
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
使用指引
</a></div><div class="nav-item"><a href="/ee/" class="nav-link">
商业版
</a></div><div class="nav-item"><a href="https://github.com/khs1994-docker/lnmp" target="_blank" rel="noopener noreferrer" class="nav-link external">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://zan.khs1994.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
捐赠
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console" target="_blank" rel="noopener noreferrer" class="nav-link external">
腾讯云服务器限时秒杀
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Introduction</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/" aria-current="page" class="sidebar-link">khs1994-docker/lnmp 支持文档</a></li><li><a href="/why.html" class="sidebar-link">项目初衷</a></li><li><a href="/docker.html" class="sidebar-link">安装 Docker</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>安装</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/install/linux.html" class="sidebar-link">Linux/macOS 上安装</a></li><li><a href="/install/windows.html" class="sidebar-link">Windows 上安装</a></li><li><a href="/mysql.html" class="sidebar-link">MySQL</a></li><li><a href="/update.html" class="sidebar-link">更新</a></li><li><a href="/cli.html" class="sidebar-link">命令行工具</a></li><li><a href="/init.html" class="sidebar-link">初始化过程</a></li><li><a href="/path.html" class="sidebar-link">本地路径和 Docker 内路径对应关系</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>开发环境</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/development.html" class="sidebar-link">开发环境</a></li><li><a href="/phpmyadmin.html" class="sidebar-link">phpMyAdmin</a></li><li><a href="/custom.html" class="sidebar-link">个性化方案</a></li><li><a href="/lrew.html" class="sidebar-link">lrew</a></li><li><a href="/backup.html" class="sidebar-link">备份恢复</a></li><li><a href="/cleanup.html" class="sidebar-link">清理</a></li><li><a href="/config.html" class="sidebar-link">软件配置</a></li><li><a href="/port.html" class="sidebar-link">服务端口开放</a></li><li><a href="/command.html" class="sidebar-link">PHPer 常用命令容器化</a></li><li><a href="/lpm.html" class="sidebar-link">包管理工具 lpm</a></li><li><a href="/compose.html" class="sidebar-link">Docker Compose</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>nginx</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/nginx/" class="sidebar-link">NGINX</a></li><li><a href="/nginx/config.html" class="sidebar-link">一键生成 nginx 配置</a></li><li><a href="/nginx/issue-ssl.html" class="sidebar-link">申请 SSL 证书</a></li><li><a href="/nginx/https.html" class="sidebar-link">NGINX HTTPS 配置文件</a></li><li><a href="/nginx/unit.html" class="sidebar-link">NGINX Unit</a></li><li><a href="/nginx/arg.html" class="sidebar-link">Nginx 内置变量</a></li><li><a href="/nginx/http3.html" class="sidebar-link">http3</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>PHP</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/php.html" class="sidebar-link">PHP 扩展列表</a></li><li><a href="/xdebug.html" aria-current="page" class="active sidebar-link">Xdebug in Docker + PhpStorm</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/xdebug.html#启用-xdebug-扩展" class="sidebar-link">启用 xdebug 扩展</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#准备-php-项目" class="sidebar-link">准备 PHP 项目</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#设置-xdebug" class="sidebar-link">设置 Xdebug</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#重启容器" class="sidebar-link">重启容器</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#在-ide-设置中配置-xdebug" class="sidebar-link">在 IDE 设置中配置 Xdebug</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#浏览器扩展" class="sidebar-link">浏览器扩展</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#使用步骤" class="sidebar-link">使用步骤</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#排错" class="sidebar-link">排错</a></li><li class="sidebar-sub-header"><a href="/xdebug.html#more-information" class="sidebar-link">More Information</a></li></ul></li><li><a href="/laravel.html" class="sidebar-link">Laravel 最佳实践</a></li><li><a href="/composer.html" class="sidebar-link">Composer 最佳实践</a></li><li><a href="/phpunit.html" class="sidebar-link">PHPUnit in Docker + PHPStorm 最佳实践</a></li><li><a href="/xhprof.html" class="sidebar-link">XHProf</a></li><li><a href="/swoole.html" class="sidebar-link">Swoole</a></li><li><a href="/composer/" class="sidebar-link">Composer</a></li><li><a href="/composer/satis.html" class="sidebar-link">Satis</a></li><li><a href="/symfony.html" class="sidebar-link">Symfony</a></li><li><a href="/php_eol.html" class="sidebar-link">使用 EOL 的 PHP 版本</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>生产环境</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/production.html" class="sidebar-link">配置</a></li><li><a href="/swarm/" class="sidebar-link">Docker Swarm</a></li><li><a href="/kubernetes/" class="sidebar-link">在 Kubernetes 集群部署 LNMP</a></li><li><a href="/kubernetes/docker-desktop.html" class="sidebar-link">K8s on Docker Desktop</a></li><li><a href="/registry.html" class="sidebar-link">Docker Registry</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>计划任务</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/crontab.html" class="sidebar-link">Crontab 计划任务</a></li><li><a href="/supervisord.html" class="sidebar-link">Supervisord</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>镜像构建</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/manifest.html" class="sidebar-link">构建支持多种架构的 Docker 镜像</a></li><li><a href="/buildx.html" class="sidebar-link">docker buildx</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>数据卷 Volumes</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/volumes/nfs.html" class="sidebar-link">NFS Volume(NFSv4)</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>集群</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/clusterkit/" class="sidebar-link">ClusterKit</a></li><li><a href="/clusterkit/memcached.html" class="sidebar-link">Memcached</a></li><li><a href="/clusterkit/mysql.html" class="sidebar-link">MySQL 复制</a></li><li><a href="/clusterkit/redis_cluster.html" class="sidebar-link">Redis 集群版 (redis-cli --cluster)</a></li><li><a href="/clusterkit/redis_replication.html" class="sidebar-link">Redis 主从版 (M-S) 复制模式 replication</a></li><li><a href="/clusterkit/redis_sentinel.html" class="sidebar-link">Redis 哨兵版 Sentinel</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>参考</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/dockerd.html" class="sidebar-link">dockerd</a></li><li><a href="/dockerfiles.html" class="sidebar-link">Dockerfile 注意事项</a></li><li><a href="/systemd.html" class="sidebar-link">systemd</a></li><li><a href="/journalctl.html" class="sidebar-link">systemd 日志管理</a></li><li><a href="/git.html" class="sidebar-link">Git Tips</a></li><li><a href="/gpg.html" class="sidebar-link">Git GPG</a></li><li><a href="/network.html" class="sidebar-link">国内网络问题</a></li><li><a href="/mirror.html" class="sidebar-link">Docker 常用镜像站点</a></li><li><a href="/windows/container.html" class="sidebar-link">Windows Container</a></li><li><a href="/arm.html" class="sidebar-link">ARM 架构</a></li><li><a href="/ab.html" class="sidebar-link">ab command</a></li><li><a href="/minio.html" class="sidebar-link">Minio</a></li><li><a href="/windows/wsl2.html" class="sidebar-link">WSL2</a></li><li><a href="/powershell.html" class="sidebar-link">PowerShell</a></li><li><a href="/go.html" class="sidebar-link">Go</a></li><li><a href="/github.html" class="sidebar-link">GitHub</a></li><li><a href="/vscode.html" class="sidebar-link">VSCode</a></li><li><a href="/cgroupv2.html" class="sidebar-link">cGroupv2</a></li><li><a href="/iscsi.html" class="sidebar-link">ISCSI</a></li><li><a href="/mount.html" class="sidebar-link">文件挂载相关命令</a></li><li><a href="/cfssl.html" class="sidebar-link">CFSSL</a></li><li><a href="/ssh.html" class="sidebar-link">SSH</a></li><li><a href="/encrypt.html" class="sidebar-link">加解密文件</a></li><li><a href="/coding/ci.html" class="sidebar-link">【玩转腾讯云】在 CODING DevOps 持续集成中使用 Buildx 构建 Docker 镜像</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="xdebug-in-docker-phpstorm"><a href="#xdebug-in-docker-phpstorm" class="header-anchor">#</a> Xdebug in Docker + PhpStorm</h1> <ul><li>https://xdebug.org/docs/all_settings</li></ul> <p><strong>启用 Xdebug 扩展会使 PHP 响应变慢,建议仅在需要调试时打开!</strong></p> <h2 id="启用-xdebug-扩展"><a href="#启用-xdebug-扩展" class="header-anchor">#</a> 启用 xdebug 扩展</h2> <blockquote><p>不建议在生产环境启用 <code>xdebug</code></p></blockquote> <p>编辑 <code>config/php/docker-php.ini</code> 文件,取消注释</p> <div class="language-diff extra-class"><pre class="language-diff"><code><span class="token deleted-sign deleted"><span class="token prefix deleted">-</span><span class="token line"> ; zend_extension=xdebug
</span></span><span class="token inserted-sign inserted"><span class="token prefix inserted">+</span><span class="token line"> zend_extension=xdebug
</span></span></code></pre></div><h2 id="准备-php-项目"><a href="#准备-php-项目" class="header-anchor">#</a> 准备 PHP 项目</h2> <ul><li><p>PHP 项目</p></li> <li><p>NGINX 配置</p></li> <li><p>验证浏览器能通过网址访问到你的 PHP 项目</p></li></ul> <h2 id="设置-xdebug"><a href="#设置-xdebug" class="header-anchor">#</a> 设置 Xdebug</h2> <h3 id="调试-host-必选项"><a href="#调试-host-必选项" class="header-anchor">#</a> 调试 HOST (必选项)</h3> <p>编辑 <code>.env</code> 文件中的 <code>LNMP_XDEBUG_REMOTE_HOST=192.168.199.100</code> 变量为你电脑的 IP,这就要求你的电脑必须固定 IP。不然电脑 IP 每次变化时,必须重新修改此变量。</p> <h4 id="_1-docker-desktop"><a href="#_1-docker-desktop" class="header-anchor">#</a> 1. Docker Desktop</h4> <p>在 Docker 设置中没有配置自定义 DNS 的情况下可以使用 <code>LNMP_XDEBUG_REMOTE_HOST=host.docker.internal</code>。</p> <h4 id="_2-docker-for-linux"><a href="#_2-docker-for-linux" class="header-anchor">#</a> 2. Docker for Linux</h4> <p>要么电脑固定 IP,要么 IP 变化时编辑 <code>.env</code> 文件中的 <code>LNMP_XDEBUG_REMOTE_HOST</code> 变量</p> <h3 id="调试端口-可选项"><a href="#调试端口-可选项" class="header-anchor">#</a> 调试端口(可选项)</h3> <p>编辑 <code>.env</code> 文件中的 <code>LNMP_XDEBUG_REMOTE_PORT=9003</code> 变量,默认 <code>9003</code></p> <h3 id="警告"><a href="#警告" class="header-anchor">#</a> 警告</h3> <p>其他选项严禁修改,除非你明确知道某个选项将产生什么影响。</p> <h2 id="重启容器"><a href="#重启容器" class="header-anchor">#</a> 重启容器</h2> <div class="language-bash extra-class"><pre class="language-bash"><code>$ ./lnmp-docker restart php8
</code></pre></div><h2 id="在-ide-设置中配置-xdebug"><a href="#在-ide-设置中配置-xdebug" class="header-anchor">#</a> 在 <code>IDE</code> 设置中配置 <code>Xdebug</code></h2> <p><code>Preferenences</code> -> <code>Languages & ...</code>-> <code>PHP</code> -> <code>Debug</code>-> <code>xdebug</code>-> <code>Debug port 9003</code>(默认为 <code>9000</code>,这里改为 <code>9003</code>)</p> <h2 id="浏览器扩展"><a href="#浏览器扩展" class="header-anchor">#</a> <a href="https://www.jetbrains.com/help/phpstorm/2022.1/browser-debugging-extensions.html" target="_blank" rel="noopener noreferrer">浏览器扩展<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></h2> <ul><li><a href="https://github.com/BrianGilbert/xdebug-helper-for-firefox" target="_blank" rel="noopener noreferrer">火狐<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/mac-cain13/xdebug-helper-for-chrome" target="_blank" rel="noopener noreferrer">Chrome<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://microsoftedge.microsoft.com/addons/detail/xdebug-helper/ggnngifabofaddiejjeagbaebkejomen?hl=zh-CN" target="_blank" rel="noopener noreferrer">Edge<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>在扩展配置中 IDE key 选择 PhpStorm</strong></p> <h2 id="使用步骤"><a href="#使用步骤" class="header-anchor">#</a> 使用步骤</h2> <ul><li><p>1.IDE 中开启调试 <code>Run</code> -> <code>Start Listening for PHP Debug Connections</code>(如果是 <code>Stop Listening ...</code> 说明已经开启了调试)</p></li> <li><p>2.编写代码</p></li> <li><p>3.打断点</p></li> <li><p>4.浏览器打开对应页面,在页面点击扩展图标,选择 <code>debug</code>,之后刷新页面</p></li> <li><p>5.自动跳转到 IDE,开始调试</p></li> <li><p>6.首次刷新 IDE 会出现配置窗口,直接点击 <code>Accept</code> 即可。(仅需配置一次)</p></li> <li><p>7.配置路径对应关系,由于本地代码目录结构与容器中的不一致,我们必须配置其对应关系,设置页面,<code>Preferenences</code> -> <code>Languages & ...</code>-> <code>PHP</code> -> <code>Servers</code> -> <code>C:\Users\username\app\laravel(本地路径)</code> 对应 <code>/app/laravel(容器路径)</code>(请根据实际情况配置)(仅需配置一次)</p></li></ul> <h2 id="排错"><a href="#排错" class="header-anchor">#</a> 排错</h2> <p>打开 <code>log/php/xdebug-remote.log</code> 查看日志。</p> <h2 id="more-information"><a href="#more-information" class="header-anchor">#</a> More Information</h2> <ul><li><p>https://xdebug.org/docs/step_debug</p></li> <li><p>https://segmentfault.com/a/1190000010833434</p></li> <li><p>https://www.jetbrains.com/help/phpstorm/docker.html</p></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/khs1994-docker/lnmp/edit/master/docs/xdebug.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
←
<a href="/php.html" class="prev">
PHP 扩展列表
</a></span> <span class="next"><a href="/laravel.html">
Laravel 最佳实践
</a>
→
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/assets/js/app.81b020fa.js" defer></script><script src="/assets/js/2.8af6cdaa.js" defer></script><script src="/assets/js/102.ff3dbb6b.js" defer></script>
</body>
</html>