问题
Test scripts are located in ...\Apache\htdocs\myproject.local\web\tests\
, web
in PhpStorm project is marked as Resources, for Apache it is site's DocumentRoot, everywhere in PhpStorm settings server is set to myproject.local:80
(domain of my web-application on the local server), but when I launch script from PhpStorm using Open in browser
I see address like this:
http://localhost:49845/myproject.local/tests/NativeSandbox.php
Where did it come from? I need address like
http://myproject.local/tests/NativeSandbox.php
How can I get this?
P.S. PHPUnit, Xdebug, and console launching scripts in PhpStorm works well.
回答1:
You need to create and configure Deployment entry (e.g. In place
type should be just fine; just make sure that you fill all fields on first 2 tabs) and mark it as Default for this project -- URL will be taken from there.
Without deployment entry (like in your case) PhpStorm will use own built-in simple web server (custom port is used (typically 643342) + project name is in the path).
来源:https://stackoverflow.com/questions/35234830/how-to-launch-scripts-in-browser-from-phpstorm-with-correct-address