How I keep xDebug in php.ini.hbs in LocalWP consistent

When you setup LocalWP and switch PHP versions it re-creates various php.ini.hbs files for each version (and the currently running) of PHP.

The problem is that it resets the xDebug config to use port 9003 every time. Furthermore it always turns off autostart in xDebug v3.

I want my port to be 9021 in every PHP version, and I want autostart on by default. But when I switch PHP versions my configuration isn’t retained.

So, I wrote a small script to help me keep my php.ini.hbs files consistent if it’s ever de-configured my PHP version switching.

  • Check it out here