php 如何更改 wamp 服务器的端口以及如何创建第一个应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14515084/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to change port of wamp server and how to create first application
提问by Abhishek
i have just instsalled wamp server but when i'm trying to access localhost it is not accessible I think it is problem with the port because wamp uses port 80 by default. and after that i want to create a dynamic website i've never used php in past so i want to know how to get satarted ... thanks
我刚刚安装了 wamp 服务器,但是当我尝试访问 localhost 时,它无法访问我认为这是端口问题,因为 wamp 默认使用端口 80。在那之后,我想创建一个动态网站,我过去从未使用过 php,所以我想知道如何开始……谢谢
I have tried in another system . I installed wamp and saw that localhost is accesible there but when i connected to the internet by modem wamp server stop working . I am totally confused about this port setting . I have unplugged lan cable from my laptop and restated the system then tried even it is not working .. i have changed httpd.conf file but it doesn't helps me
我曾在另一个系统中尝试过。我安装了 wamp 并看到本地主机在那里可以访问,但是当我通过调制解调器 wamp 服务器连接到互联网时,它停止工作。我对这个端口设置完全困惑。我已经从我的笔记本电脑上拔下 LAN 电缆并重新启动系统然后尝试即使它不工作..我已经更改了 httpd.conf 文件,但它对我没有帮助
采纳答案by Dipesh Parmar
First of all change Listen 80to Listen PORT YOU WANTin Apache httpd.conf file.
首先更改Listen 80为Listen PORT YOU WANTApache 中的 httpd.conf 文件。
Now in the same file search for the word vhost you will find it three time just uncomment it by removing # from beginning of statement (you will find it two time in one statement) .
现在在同一个文件中搜索 vhost 这个词,你会发现它三次,只需通过从语句的开头删除 # 来取消它的注释(你会在一个语句中找到它两次)。
Now open http-vhosts.conf file which is inside C:\wamp\bin\apache\Apache2.2.17\conf\extra\and paste below code with port modification and you are done.
现在打开里面的 http-vhosts.conf 文件C:\wamp\bin\apache\Apache2.2.17\conf\extra\并粘贴下面的代码并修改端口,你就完成了。
Using this you can set more than one port to different directory.
使用它,您可以将多个端口设置到不同的目录。
<VirtualHost *:5>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www"
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
#ServerName dummy-host2.localhost
#ErrorLog "logs/dummy-host2.localhost-error_log"
#CustomLog "logs/dummy-host2.localhost-access_log common"
</VirtualHost>
just change <VirtualHost *:5>this to whatever port you need and restart Apache and all other service.
只需将其更改<VirtualHost *:5>为您需要的任何端口并重新启动 Apache 和所有其他服务。
Now Cheers. Enjoy
现在干杯。享受
回答by Devang Rathod
For change wamp server port number :
更改 wamp 服务器端口号:
1. Go to \wamp\bin\apache\apache2.2.8\conf
2. Open “httpd.conf” in notepad
3. Find “Listen 80” and Change it to your desired port
(for example : Listen 8081)
4. Save it and close it .
Restart wamp server and check.
重新启动 wamp 服务器并检查。
回答by tomexsans
To get you started on your
为了让你开始你的
C:/wamp/wwwdirectory there you would put all your files its up to you how you structure you files.
C:/wamp/www目录在那里,您可以将所有文件放在那里,这取决于您如何构建文件。
AND if you are using skype, try running wampserver before opening skype, skype uses port 80 as with the default wampserver port. OPEN wampserver before using skype. No Problem and No Need To change PORT. also not only skype but other programs to uses PORT 80, before doing anything OPEN wamp first before other programs.
而且,如果您使用的是 Skype,请在打开 Skype 之前尝试运行 wampserver,Skype 使用端口 80 作为默认 wampserver 端口。在使用 Skype 之前打开 wampserver。没问题,无需更改端口。不仅Skype而且其他程序也使用PORT 80,然后在其他程序之前先打开wamp。
回答by Richard Williamson
After using google, I found the answer for you.
使用谷歌后,我为你找到了答案。
Open httpd.conf and find the line with: Listen 80
打开 httpd.conf 并找到以下行:Listen 80
80 is the port number, so change it to any number you want.
80 是端口号,因此将其更改为您想要的任何数字。

