Skip to content

Install Xdebug on Hypernode Docker #8

Open

Description

@Bonno

Is it possible to have xdebug preinstalled in the docker image?
Possible in the same manner as for the vagrant image? https://support.hypernode.com/knowledgebase/configure-xdebug-hypernode-vagrant/

Activity

  1. vdloo commented on Jul 4, 2018

    @vdloo
    Member

    Have you tried apt-get install php-xdebug? I don't know if there's anything different about the vagrant that might cause it to have problems, but installing that package should place the .ini files so perhaps that will just work:

    root@837c5e816b80 ~ # dpkg -L php-xdebug
    /.
    /etc
    /etc/php
    /etc/php/5.5
    /etc/php/5.5/mods-available
    /etc/php/5.5/mods-available/xdebug.ini
    /etc/php/5.6
    /etc/php/5.6/mods-available
    /etc/php/5.6/mods-available/xdebug.ini
    /etc/php/7.0
    /etc/php/7.0/mods-available
    /etc/php/7.0/mods-available/xdebug.ini
    /etc/php/7.1
    /etc/php/7.1/mods-available
    /etc/php/7.1/mods-available/xdebug.ini
    /usr
    /usr/lib
    /usr/lib/php
    /usr/lib/php/20131226
    /usr/lib/php/20131226/xdebug.so
    /usr/lib/php/20160303
    /usr/lib/php/20160303/xdebug.so
    /usr/lib/php/20121212
    /usr/lib/php/20121212/xdebug.so
    /usr/lib/php/20151012
    /usr/lib/php/20151012/xdebug.so
    /usr/share
    /usr/share/doc
    /usr/share/doc/php-xdebug
    /usr/share/doc/php-xdebug/changelog.Debian.gz
    /usr/share/doc/php-xdebug/copyright
    root@837c5e816b80 ~ # php -m | grep xdebug -i
    xdebug
    Xdebug
  2. Bonno commented on Jul 4, 2018

    @Bonno
    Author

    I was hoping it can be installed by default in the image. So we can use the config settings in /data/web/public/.user.ini as described in the hypernode-vagrant documentation. I'll probably can get it to work with a manual installation and configuration, but it would be cool to have this feature out-of-the-box.
    Not a huge issue, but since it seems to be supported on the vagrant image I was hoping it could be integrated in the docker image.

  3. vdloo commented on Jul 4, 2018

    @vdloo
    Member

    Hi Bonno, I purposely did not put this in the default image because I think for most use-cases this would not be needed and creating a Dockerfile that adds this if you need it would be trivial. But I am a proponent of good defaults, so perhaps this is something we might consider in the future. But for now I suggest if you want to use xdebug with this Docker to create a Dockerfile that installs the package. Perhaps that would be something that you could document in this repo for other users?

  4. Bonno commented on Jul 4, 2018

    @Bonno
    Author

    Thanks for your answers. The Dockerfile needed to make this work only needs to contain the following RUN command.

    RUN apt-get update && apt-get install -y php-xdebug

    Then you can set the xdebug configuration in /data/web/public/.user.ini

    xdebug.show_error_trace = 1
    xdebug.remote_enable = 1
    
    ; Debug from 1 specific machine (Disable xdebug.remote_connect_back for this to work.)
    xdebug.remote_connect_back = 0
    xdebug.remote_host = IP.address.from.host
    xdebug.remote_port = 9000
    xdebug.scream = 0
    xdebug.show_local_vars = 1
    xdebug.idekey = PHPSTORM
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions