我的问题是当我开始监听端口时,xdebug无法工作。我认为PhpStorm无法与xdebug链接。我只能得到调试器面板变量不可用的提示。看起来xdebug没有正确的设置。
使用的软件和版本:
我的
使用的软件和版本:
Ubuntu 16.04 LTS
Docker v 17.06
docker-compose 1.15
我一直试图设置xdebug+Docker+PhpStorm,但是一直无法做到。我已经阅读了很多教程,但都没有帮助到我。
我的docker-compose.yml
文件如下:
version: '3'
services:
web:
image: nginx:latest
ports:
- "80:80"
restart: on-failure
volumes:
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./etc/ssl:/etc/ssl"
- "./project:/var/www/html/project"
depends_on:
- php
- db
php:
image: nanoninja/php-fpm
restart: on-failure
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./project:/var/www/html/project"
db:
image: mysql
container_name: ${MYSQL_HOST}
restart: on-failure
env_file:
- ".env"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
command: mysqld --sql-mode=NO_ENGINE_SUBSTITUTION
ports:
- "8988:3306"
volumes:
- "./data/db/mysql:/var/lib/mysql"
我的
xdebug.ini
文件如下:xdebug.default_enable=0
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
xdebug.idekey="PHPSTORM"
xdebug.profiler_enable=0
xdebug.remote_host=localhost
PhpStorm设置: