Xdebug inside docker in PhpStorm doesn't work

I have trouble getting xdebug to work inside docker on a remote VPS. Is this even possible? I have tried almost every possible combination of values but nothing seems to work.

I’d like to remotely debug a PHP app inside a docker container, more specifically Laradock. Is there something wrong in my configuration?

  • Building a Docker images fails when a User tries to execute javac
  • how to read files from a python module inside docker
  • How can I copy a file from one folder to another folder within a container in Docker?
  • Need to convert this relatively simple docker pull and run commands into a docker-compose.yml file?
  • Connecting a Docker container to a network interface / device instead of an IP address
  • Compass provision failing with Docker compose up
  • For the record, I’ve also opened my firewall to see if the problem lied there, PhpStorm is also listening for connections, but alas. Any help would be greatly appreciated… If I need to supply more info, I will gladly do so.

    PhpStorm error
    PhpStorm error

    the docker containers
    docker containers

    PhpStorm settings
    enter image description here

    PhpStorm settings remote interpreter
    enter image description here

    xdebug in container runs
    Xdebug is loaded

        ### Workspace Utilities Container ###########################
    
    workspace:
        build:
            context: ./workspace
            args:
                - INSTALL_XDEBUG=true
                - INSTALL_MONGO=false
                - INSTALL_NODE=true
                - INSTALL_YARN=false
                - INSTALL_DRUSH=false
                - INSTALL_AEROSPIKE_EXTENSION=false
                - INSTALL_V8JS_EXTENSION=false
                - COMPOSER_GLOBAL_INSTALL=false
                - INSTALL_WORKSPACE_SSH=true
                - INSTALL_LARAVEL_ENVOY=true
                - PUID=1000
                - PGID=1000
                - NODE_VERSION=stable
                - YARN_VERSION=latest
                - TZ=CET
        volumes_from:
            - applications
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to
            - "dockerhost:192.168.128.3"
        ports:
           - "2222:22"
        tty: true
    
    ### PHP-FPM Container #######################################
    
    php-fpm:
        build:
            context: ./php-fpm
            args:
                - INSTALL_XDEBUG=true
                - INSTALL_SOAP=true
                - INSTALL_MONGO=false
                - INSTALL_ZIP_ARCHIVE=true
                - INSTALL_BCMATH=false
                - INSTALL_MEMCACHED=false
                - INSTALL_OPCACHE=true
                - INSTALL_AEROSPIKE_EXTENSION=true
                - CODEIGNITER=false
            dockerfile: Dockerfile-70
        volumes_from:
            - applications
        expose:
            - "9000"
        links:
            - workspace
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to
           - "dockerhost:192.168.128.3"
        environment:
        # IMPORTANT: Set the Remote Interpreter entry matching name to laravel
            - PHP_IDE_CONFIG=serverName=laravel
    

  • fig.sh and mysql container losing all data after stopping services
  • context or workdir for docker-compose
  • (Docker) Getting error: docker-php-source: no such file or directory when building docker file
  • APK is not installing in docker emulator
  • Node ECS Task Not Crashing
  • Docker multiple entrypoints
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.