如何在PhpStorm中设置内置的Web服务器 [英] how to setup built-in webserver in PhpStorm
问题描述
设置:
1)操作系统-Win 8.1
2)WAMP
3)PhpStorm 7.1.3
我从事Dreamweaver的工作已经很长时间了,最近由于功能有限,我放弃了它.使用Dreamweaver设置本地环境非常简单,我对此没有任何问题.因此,我安装了PhpStorm,以为使用DW时以相同的方式运行我的PHP Web应用程序非常容易,但是当我尝试使用其内置的Web服务器在PhpStorm中运行我的Web应用程序时,出现502 Bad Gateway
错误,这是什么?我所做的只是在PhpStorm中导入文件夹(位于www目录中)并尝试在浏览器上运行它,但是我无法使其在本地运行.我相信我必须在设置下设置解释器,但是我该如何进行操作以及应包括哪些内容呢?
当我使用WAMP运行Web应用程序时,URL看起来像
http://localhost/appname/trunk/public/
当我使用PhpStorm内置的网络服务器运行它时,URL看起来像
http://localhost:63342/appname/trunk/public/
错误:502错误的网关.
我现在很困.
首先(检查您的解释器)
1-从文件"中选择设置"
2-在设置中导航到PHP
3-在口译员中(如果您没有口译员,您会看到类似的消息)
第二(添加新的口译员)
1-添加新的口译员从添加符号(绿色加号+)->如果您在本地计算机上工作,则选择(其他)本地
2-输入要引用的任何名称(默认PHP)
3-从PHP home *导航到您的PHP目录文件>
希望对您有帮助
*如果您使用wamp,则会在c:\ wamp \ bin \ php(您的php版本)中找到它
如果您使用xamp,则会找到它C:\ xampp \ php
Set up:
1) OS - Win 8.1
2) WAMP
3) PhpStorm 7.1.3
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?
When I run my webapp using WAMP the URL looks like
http://localhost/appname/trunk/public/
When I run it using PhpStorm built-in webserver the URL looks like
http://localhost:63342/appname/trunk/public/
Error: 502 bad gateway.
I am quite stuck now.
First (check your interpreter)
1- From File choose Setting
2- In setting navigate to PHP
3- In Interpreter (if you don't have interpreter you will see message like that )
Second (Add new interpreter)
1-Add new interpreter From Add sign (green plus +) --> choose (other)local if you work in your local pc
2-write any name you want refer to (default PHP)
3- navigate to your PHP directory file From PHP home*
I hope this help you
*If you use wamp you will find it in c:\wamp\bin\php(your php version)
If you use xamp you will find it C:\xampp\php
这篇关于如何在PhpStorm中设置内置的Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!