Reputation: 117
I setup live edit in PhpStorm and it works great. While implementing routing in my application, I configured PhpStorm to use a routing script using the Built-in Web Server run configuration. At this point, live edit stopped working because it seems to work only with the built-in webserver and not the PHP built-in web server. (Technically, it didn't stop working, rather there were two run configurations: live edit where the links returned a 404 and a routing configuration that doesn't have live edit.)
I'm using PhpStorm 10.0.2 (PhpStorm-143.790) on CentOS 7.
Note: I found two issues relating to live edit and routing but neither was helpful.
Thanks
Upvotes: 1
Views: 664
Reputation: 117
A hint in the 2nd URL above provided a suitable workaround. The key lies in the fact the link between the browser and PhpStorm is not tied to the URL; only the tab. To make this work, you need two run configurations:
JavaScript Debug
configuration for live edit. Make sure live edit is working.PHP Built-in Web Server
configuration with the router script enabled.Run the JavaScript Debug
configuration and it will open a tab in Chrome linked to PhpStorm. Then start the PHP Built-in Web Server
configuration and change the "live edit" tab to the URL for the built-in web server. Any changes will automatically refresh the tab using the PHP Built-in Web Server
configuration which contains the router functionality.
This concept can also be applied to any functionality not supported by the built-in web server, like SSL. You just need a 2nd web server (built-in or external) and change the live edit tab to the 2nd URL.
Upvotes: 0