Put it under “Program Files”, and create task under Windows Task Scheduler to run this program with elevated privileges (To update the hosts file) after each login and the action is to run a program which points to our executable. ĭownload the release build of this program. This small application will read the new IP address of Windows WSL2 interface and update the hosts file entry accordingly. This way, we don’t have to update our PHPStorm configuration with the correct IP address every time. Ideally, a dynamic entry in hosts file that will map “wsl2.host” to this IP address. So we need a way to identify this IP address after each reboot. Let’s say the IP range of the network of WSL2 is currently in the range of “172.30.0.1″, the next time you reboot the machine, and its gonna happen with a Windows machine, the IP address will be in the range of “172.16.14.1”. The thing with WSL2, at least in its current form is that the IP range will totally change during reboots. Notice how we need to give Windows IP address to XDebug so that it can connect back to PHPStorm. It will identify our PHP installation and also tell us that Xdebug is available.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |