如何用正确的地址从PhpStorm在浏览器中启动脚本? [英] How to launch scripts in browser from PhpStorm with correct address?

查看:155
本文介绍了如何用正确的地址从PhpStorm在浏览器中启动脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

测试脚本位于PhpStorm项目的...\Apache\htdocs\myproject.local\web\tests\中,web被标记为资源,对于Apache,它是站点的DocumentRoot,在PhpStorm设置服务器中的任何地方都设置为myproject.local:80(我的Web应用程序在本地服务器),但是当我使用Open in browser从PhpStorm启动脚本时,我看到这样的地址:

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

我怎么能得到这个?

P.S. PhpStorm中的PHPUnit,Xdebug和控制台启动脚本运行良好.

P.S. PHPUnit, Xdebug, and console launching scripts in PhpStorm works well.

推荐答案

您需要创建和配置Deployment条目(例如In place类型应该很好;只需确保您填写了前2个选项卡上的所有字段),然后将其标记为该项目的默认值-URL将从此处获取.

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.

没有部署条目(如您的情况),PhpStorm将使用自己的内置简单Web服务器(使用自定义端口(通常为643342)+项目名称位于路径中).

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).

这篇关于如何用正确的地址从PhpStorm在浏览器中启动脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆