Skip to content

Ensure docker development easy works with xdebug and vscode #285

Closed
@benmarte

Description

Describe the problem

Fix xdebug settings in php.ini or 50_xdebug.ini in the openemr/openemr:flex docker image.

Describe the solution you'd like

We need to add these 2 lines of code to either php.ini in /etc/php7/ where the current xdebug config settings are in or in the 50_xdebug.ini file in /etc/php7/conf.d/

xdebug.client_host=host.docker.internal
xdebug.mode=debug

VSCode users would then need to create a launch.json file with the following code:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [    
      {
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9003,
        "externalConsole": false,
        "log": true,
        "pathMappings": {
          "/var/www/localhost/htdocs/openemr": "${workspaceRoot}"
        },
        "ignore": [
          "**/vendor/**/*.php"
        ]      
      },
      {
        "name": "Launch currently open script",
        "type": "php",
        "request": "launch",
        "program": "${file}",
        "cwd": "${fileDirname}",
        "port": 9000
    }
    ]
  }

After installing PHP Debug plugin

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