如何在 PhpStorm 中设置内置网络服务器 [英] how to setup built-in webserver in PhpStorm

查看:137
本文介绍了如何在 PhpStorm 中设置内置网络服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置:

1) 操作系统 - Win 8.1
2) WAMP
3) PhpStorm 7.1.3

1) OS - Win 8.1
2) WAMP
3) PhpStorm 7.1.3

我已经在 Dreamweaver 上工作了很长时间,最近我放弃了它,因为它的功能有限.使用 Dreamweaver 设置本地环境非常简单,我对此没有任何问题.所以我安装了 PhpStorm 认为在使用 DW 时以同样的方式运行我的 PHP Web 应用程序会很容易,但是当我尝试使用其内置的网络服务器在 PhpStorm 中运行我的 Web 应用程序时,我得到 502 Bad Gateway 错误,我所做的只是在 PhpStorm 中导入文件夹(位于 www 目录中)并尝试在浏览器上运行它,但我无法让它在本地工作.我相信我必须在设置下设置解释器,但是我该如何继续,我应该包括什么?

I have been working on Dreamweaver for quite a long time and recently I ditched it because of its limited features. Setting up a local env using Dreamweaver is fairly simple and I had no problem with it. So I installed PhpStorm thinking it would quite easy to run my PHP web app in the same way when I was using DW, but When I try to run my web app in PhpStorm using its built-in webserver I get 502 Bad Gateway error, What I did is simply import the folder (which is in www directory) in PhpStorm and try to run it on browser, but I couldn't get it to work locally. I believe I have to set up Interpreter under settings, but how do I go ahead and what should I include?

当我使用 WAMP 运行我的 web 应用程序时,URL 看起来像

When I run my webapp using WAMP the URL looks like

http://localhost/appname/trunk/public/

当我使用 PhpStorm 内置网络服务器运行它时,URL 看起来像

When I run it using PhpStorm built-in webserver the URL looks like

http://localhost:63342/appname/trunk/public/

错误:502 网关错误.

Error: 502 bad gateway.

我现在很困.

推荐答案

首先(检查你的解释器)

First (check your interpreter)

1- 从文件中选择设置

1- From File choose Setting

2- 在设置中导航到 PHP

2- In setting navigate to PHP

3- 在口译员中(如果您没有口译员,您会看到这样的消息)

3- In Interpreter (if you don't have interpreter you will see message like that )

第二个(添加新的解释器)

Second (Add new interpreter)

1-从添加符号(绿色加号)添加新解释器->如果您在本地电脑上工作,请选择(其他)本地

1-Add new interpreter From Add sign (green plus +) --> choose (other)local if you work in your local pc

2-写任何你想引用的名字(默认PHP)

2-write any name you want refer to (default PHP)

3- 从 PHP 主页导航到您的 PHP 目录文件*

3- navigate to your PHP directory file From PHP home*

希望对你有帮助

*如果你使用 wamp,你会在 c:wampinphp(你的 php 版本)中找到它

*If you use wamp you will find it in c:wampinphp(your php version)

如果你使用 xamp,你会发现它是 C:xamppphp

If you use xamp you will find it C:xamppphp

这篇关于如何在 PhpStorm 中设置内置网络服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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