I recommend setting xdebug.profiler_output_dir to your OS temporary file directory if using it. I found 18gb that had gone missing in the form of profiler logs that were in my installation directory.
Good catch! I've updated the post :)
How would you do this with a docker instance, or really multiple docker instances. I have two separate projects that each run their own separate containers using the same docker set up. The only thing I change in order to get them running is the port that they bind too. One of my projects are on localhost and the other localhost:8085. I was able to get xdebug running on one of them by running 'sudo ifconfig lo0 alias 10.254.254.254' to create what i believe is a static IP, but can not get it running on the other project. Any insight would be immensely helpful.
Hi Arik, I've not used Xdebug within a Docker instance myself I'm afraid. Hope you get it resolved :)
I'm trying to get Xdebug working with Xdebug for Sublime Text 3 but can't get the integration working. Anyone else use Xdebug for Sublime Text 3?
Hello! I used to use Sublime but now Atom. You can get it set up with all the functionality just as PhpStorm has but in the prettier Atom GUI. Generally you need to install a Chrome extension to trigger or add a query variable localhost:3000/?XDEBUG_SESSION_START.
For the life of me, I cannot get Xdebug to work. Installed and re-installed via Homebrew. Everything checks out in php --version and php -i when plugged into https://xdebug.org/wizard.php Everything checks out except I cannot get Xdebug to show anything in either PhpStorm or Sublime. No information in Frames or Variables in PhpStorm even after Validating Debugger Configuration on Web Server and connecting in Chrome to JetBrains IDE Support What's up? I can set breakpoints all over and break php functions and I get no information about anything beyond the occasional Javascript error.
Hey Alex. I'll double check my set up later or tomorrow. I'm using Brew to run PHP5.6/7/7.1 with relevant Xdebugs. Are you using PHP-FPM? I also use this (installed via Brew) to toggle Xdebug on / off. https://github.com/w00fz/xdebug-osx
Thanks! I actually just got it working. Reading through the debug logs, I saw "Creating socket for '::1:9000', poll success, but error: Operation now in progress (19)." which lead me here : http://techqa.info/programming/question/41423139/phpstorm+xdebug-hits-a-breakpoint-only-when-using-external-ip-address And turning xdebug.remote_connect_back to 0 (the default value) solved the issue. Xdebug documentation: If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP request. It checks the $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR'] variables to find out which IP address to use. Counterintuitive but there you go...
Glad to hear you got it working, Alex!
Ian, I appreciate the detail you go into with these xdebug posts. When I was first learning how to set everything up, resources were sparse and not thorough. I learn something new each time. Keep it up.
Thanks for the kind words, Justin!
In this time there are more users are have more eager about PHP Debugging tools and they find more helps from here. I think it will be so more better for us that we find more information also from here.
Can I use xdebug without having to download the whole project to local? My website is hosted on my own ubuntu server, I usually download the PHP file I want to debug, modify it using Atom and upload it back to server to see the change(I use Fireftp to make the downloading,editing,uploading a lot smoother)
There's no reason you can't debug on your remote ubuntu server like this https://deliciousbrains.com/xdebug-advanced-php-debugging/#remote-debugging
"Do you work with a different local environment and need some guidance? Let us know in the comments." The only environment I use is my own custom CMS, with the only tool I use for developing it being the CMS itself. Apart from automated tools within the framework I've made, I use just Codemirror for viewing and modifying PHP. Could you please give me some advice on how I could go about making Xdebug work in my live environment using Codemirror? NB I'm using Centos 7 with Nginx.
I guess is not possible to run without phpstorm...
Possible with the free eclipse php ide on any platform that supports it (many) and on which xdebug available, though the remote option Iain describes adds more possibilities. Lots of web resources on how to setup. Some pics of 'quick and dirty' arrangement here ... https://photos.app.goo.gl/Mo8VxzF8ZJq3ssPr5
I would like to now how to "debug production", I am trying to do that for months
+1 for Ray :) I always had issues setting up Xdebug on Windows and Ray just works :)
I can't get Xdebug working with Vscode. I get brief lot of activity show in the debugger call stack when loading the php app in the browser, but Vscode just spits out errors in the debug console: connection 2: read ECONNRESET, connection 3: read ECONNRESET etc. I'm using Valet+ and have the correct ports setup etc. Anyone have any clues?
FYI, depending on your webserver, you can use different php configs for each site/vhost. I use OpenLiteSpeed, which makes it relatively easy to do this. I just copy all of the php.ini files into a folder in the vhost directory and, change the vhost config to point to that path. Then when I'm connected to a specific vhost/site via SSH, I can easily turn xdebug modes on/off right from my IDE (and then restarting php on the server). So, live sites can have xdebug turned off while staging/dev sites can have it turned on (or off to compare performance).