- In docker-compose.yml expose 9000 port for php:
version: '3'
services:
webserver:
image: nginx:latest
ports:
- 8080:80
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./:/var/www/html
php:
build: ./docker/php/
expose:
- 9000
volumes:
- .:/var/www/html
- ./docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- Install Xdebug 3 in the PHP container:
./docker/php/Dockerfile
FROM php:7.4-fpm RUN pecl install xdebug \ && docker-php-ext-enable xdebug
- Configure Xdebug for Step Debugging:
- Create the configuration file:
docker/php/conf.d/xdebug.ini
:zend_extension=xdebug [xdebug] xdebug.mode=develop,debug xdebug.client_host=host.docker.internal xdebug.start_with_request=yes
- In PHP strom Xdebug settings use
9003
port
======