-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add xdebug make command. #378
Conversation
Converting this to draft because it has the gateway timeout problem that the code environment has. Need to stuff in settings like this: NGINX_CLIENT_BODY_TIMEOUT=3600s so want to figure out a way to do that just when the user runs make starter_ddev |
If you want those to be the defaults, we'll need to edit |
It looks like I can also put them in https://github.com/Islandora-Devops/isle-dc/blob/development/build/docker-compose/docker-compose.drupal.yml But I think we should maybe make these only get set to such big values if the user runs 'make starter_dev' as opposed to 'make starter'. Will tinker more when I have some free time. |
@seth-shaw-asu This is ready to test. On a clean ISLE-DC, $ cp sample-dev.env Then set a breakpoint in e.g. codebase/web/index.php, start debugging (F5 in VSCode) and laod any page. |
Testing this PR. The php extension is installed. The config file gets installed properly. Able to launch the debug server/service via the launch.json. It says "Listening to Xdebug on port 0.0.0.0:9003 ...". I have the chrome plugin to set the xdebug cookie. However, the breakpoint does not get hit in the vs code. Nothing in the xdebug log. |
It works great on my mac. I used Intellij IDEA and threw a breakpoint in index.php and on "listening" mode it immediately caught the incoming xdebug connection. I didn't have to click the old "Start Debugger" bookmarklet. Neato! |
The Xdebug part worked. But after running That said, i didn't follow the steps outlined in @alxp's comment above, and just ran |
@alxp To get it to work on my Ubuntu machine I had to make a couple of small modifications. This could be nothing and could be nothing but here's what I changed
Without the delay I get this error message
And if you want it to come up with the
I'm not sure how else to test this. I don't personally use xdebug. |
I googled a bit and learned that you can make 'host.docker.internal' work on Linux hosts by adding the following to the container definition in docker-compose: ``yaml
|
I've re-rolled this with a much simpler approach. There is now a make command that just sets all Nginx and PHP timeout values in the docker-compose.yml file and restarts docker, so the settings get picked up. It then downloads and enables XDebug. I've also added a default launch.json file that has XDebug commands correctly configured. So to test:
This is worth trying again @DonRichards @rosiel @Natkeeran however the Linux version may need a tweaked XDebug.ini. |
23aca9a
to
ae7b620
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this on a Linux laptop and it worked for me! I just needed to download the PHP Debug extension in Visual Studio Code. I set a few breakpoints in index.php and ran Listen for Xdebug.
What does this pull request do?
Adds a 'make xdebug' command which installs xdebug temporarily (until make down; make up is run again) and places a minimal working xdebug.ini file in the php82 config filder.
How should this be teste>??
The breakpoint should stop code execution and you should be able to do all the usual things.
When you're done, run 'make down' and then ''make up'. XDebug should no longer be installed.