如何设置 Eclipse 以使用 XAMPP 在我的本地主机上运行 php 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34273690/
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 do I set up Eclipse to run php files on my localhost using XAMPP?
提问by Olympus
I am using Eclipse MARS edition and getting my feet wet with php. I want to know how to configure eclipse so that when I run the php file it will open it in http://localhost. I have XAMPP already installed and it is working. How do I do this?
我正在使用 Eclipse MARS 版本并用 php 弄湿了我的脚。我想知道如何配置 eclipse 以便当我运行 php 文件时它会在http://localhost 中打开它。我已经安装了 XAMPP 并且它正在工作。我该怎么做呢?
回答by Ilia
1-stop your apache server 2-Change c:\xampp\apache\conf\httpd.conf :
1-停止您的 apache 服务器 2-更改 c:\xampp\apache\conf\httpd.conf :
DocumentRoot "xxxxxxxxx" <Directory "xxxxxxxxx">
DocumentRoot "xxxxxxxxx" <Directory "xxxxxxxxx">
instead of xxxxxxxxx use your workspace that eclipse now use. 3-start your apache 4-Set runconfiguration 5-Add PHP Web Application 6-Configure your server :
而不是 xxxxxxxxx 使用 eclipse 现在使用的工作区。3-启动您的 apache 4-设置运行配置 5-添加 PHP Web 应用程序 6-配置您的服务器:
Server Name: http://localhost/yourworkspace Base URL : http://localhost Document Root: yourworkspace on your file system
Server Name: http://localhost/yourworkspace Base URL : http://localhost Document Root: yourworkspace on your file system
7-Path Mapping:
7-路径映射:
Path on server : / And Path in workspace : /yourworkspace
服务器上的路径:/和工作区中的路径:/yourworkspace
8-Finish ,Run and Enjoy :)
8-完成,运行和享受:)