Skip to content

Show how to configure a docker php container with xdebug to work with PHPStorm

License

Notifications You must be signed in to change notification settings

DEVizzent/php-container-xdebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-container-xdebug

How to install xdebug in a docke image

Take a look to Dockerfile

How to configure xdebug in our project

You have our example configuration: docker-php-ext-xdebug.ini

How to set up the container

    environment:
      PHP_IDE_CONFIG: 'serverName=host.docker.internal' ## to work with xdebug in docker requests
      XDEBUG_TRIGGER: ## to work with xdebug in docker cli scripts
    extra_hosts:
      - "host.docker.internal:host-gateway" ## to be able to reach the container from our IDE    

How to configure PhpStorm to connect Xdebug

  1. To configure the PhpStorm with the xdebug go to edit configurations

edit-configurations.png 2. Click on add configuration and PHP Remote Debug

add-configuration.png 3. We have to give a name to this config, I suggest your name project and add the ide key and configure a new server. IDE key must be the same we configure in xdebug.ini

configure-project.png 4. We most to give a name to the server, set the host, the port used to communicate and the directory mapping

configure-server.png 5. After save the changes you can activate the debug mode and run a script

activate-debug.png

About

Show how to configure a docker php container with xdebug to work with PHPStorm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published