Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure docker development easy works with xdebug and vscode #285

Closed
benmarte opened this issue Feb 21, 2021 · 1 comment · Fixed by #286
Closed

Ensure docker development easy works with xdebug and vscode #285

benmarte opened this issue Feb 21, 2021 · 1 comment · Fixed by #286

Comments

@benmarte
Copy link

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

@stephenwaite
Copy link
Member

stephenwaite commented Feb 21, 2021

@bradymiller suggests below launch.json for "production" development :)

{
  // 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,
      "pathMappings": {
        "/var/www/localhost/htdocs/openemr": "${workspaceFolder}"
      },
      "ignore": [
        "**/vendor/**/*.php"
      ]      
    },
    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9003
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants