After struggling for too long, I followed the nuclear route at Xdebug nightmare - #8 by Glauber (no longer open to replies or else I would have) as a starting point.
Since it worked, I compared why it worked vs my existing PhpStorm project’s settings and the only difference was the port.
So to find the port# you need, go to your phpinfo() output and see $_SERVER['SERVER_PORT']
You could also acquire this on Mac by going to this file in Finder: ~/Library/Application Support/Local/run/router/nginx/conf/route.YOURSITE.local.conf
You don’t need Path Mappings or anything else. This works:
Of course, all the other Xdebug stuff applies, but you do NOT need a browser extension, and you do not need the “Xdebug + PhpStorm” LocalWP extension - although it’d make sense if it correctly added the port# instead of inserting as 80 - therefore, this is a bug report for that extension.
I skimmed through and it looked like a thorough article!
But, I did not see mention of this part:
So to find the port# you need, go to your phpinfo() output and see $_SERVER['SERVER_PORT']
You could also acquire this on Mac by going to this file in Finder: ~/Library/Application Support/Local/run/router/nginx/conf/route.YOURSITE.local.conf
When I was going through the article, I didn’t need to use a port – PhpStorm was able to get things working. I was using the “Site Domains” router mode so maybe that was playing into it.
The server port number should automatically be set in step 6 from the walkthrough, when you’re prompted by PhpStorm to accept the incoming connection from Xdebug. You should no longer have to set it manually.