我不知道问题出在哪里,就是不能用。
路由似乎可以用,我在nginx的conf文件里有一个服务器名,比如test.com,可以用。
我的项目在ubuntu的根目录下,而不是在挂载文件夹里。
我不知道还有什么可以尝试的。
xdebug.ini
[XDebug]
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_port=9002
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=0
xdebug.remote_host=soapboxtest.com
xdebug.idekey=VSCODE
xdebug.remote_autostart=1
xdebug.remote_log=/usr/local/etc/php/xdebug.log
启动.json
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9002,
"log": true,
"externalConsole": false,
"pathMappings": {
"/var/www": "${workspaceRoot}"
},
"ignore": [
"**/vendor/**/*.php"
]
},
申请cookies
"XDEBUG_SESSION" => "VSCODE"
Docker文件
FROM php:fpm-alpine3.11
...
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
...
我也遇到过这种情况,发现XDEBUG没有寻找Docker Daemon Host。通过添加它来解决。
"hostname": "0.0.0.0"
在VS Code的launch.json的常规选项中加入: