How to launch scripts in browser from PhpStorm with correct address?

余生颓废 提交于 2019-12-25 07:03:15

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!