xDebug on newer PHP versions use port 9003 which conflict with php-fpm installed via homebrew on my mac, e.g. when I start a debugging session in Sublime Text w/ xDebug Client it barks about using port 9003 because it’s already in use.
I often set my ports to 9021 on most of my sites, including older versions of xDebug that use 2.0, etc. This is a port my system never uses.
I wish this was the default on all new sites, or at least a port that doesn’t conflict with PHP itself on Mac. This way it always worked out of the box…
Or, if there was a built-in tool to set the port on all sites (via Preferences) that would be nice too, even if it still defaulted to 9003, I could change it and on all sites it would default to that.
Lastly, I always have to set
xdebug.start_with_request=yes so sessions work without a trigger. And on PHP 5.6 (which uses xDebug 2) I have to set
xdebug.remote_autostart=1. I also wish this was on by default, or at least configurable on all sites via e.g. Preferences.
I think an overall control in UI for these settings would be amazing for using LocalWP with debugging on other platforms other than VSCode/PHP Storm. I’m also considering writing an extension, but the technical work for this might be above my knowledge to do so, so thought I would put it here too.
- Does this happen for all sites in Local, or just one in particular?
I always have to edit
conf/php*/php.ini in any site I want to use debugging on for my setup.
- Are you able to create a new, plain WordPress site in Local and access it in a Browser?
Yes, but I always have to configure xDebug to
- Auto-start with the request
- Use a different port than 9003 on PHP >5.6
- Install email@example.com via homebrew
- Spin up a site on PHP 7.4+ and try and start an xDebug session on port 9003
- Which version of Local is being used?
- What Operating System (OS) and OS version is being used?