简体   繁体   English

在PHP和Eclipse中设置路径映射

[英]Setting up path mapping in PHP and Eclipse

I have just setup my website locally so I can test my pages more easily. 我刚刚在本地设置了我的网站,因此我可以更轻松地测试我的网页。

Eclipse has been configured to use an XAMPP server locally. Eclipse已配置为在本地使用XAMPP服务器。

The problem is that I want to map my project to a certain place in my website. 问题是我想将我的项目映射到我网站的某个地方。

ie. 即。 In my Eclipse PHP project I have a folder called 在我的Eclipse PHP项目中,我有一个名为的文件夹

com

I want this to map to 我希望这个映射到

/com

in the webstie. 在网络上。

I tried to do this in the mapping section of the Eclipse server setup but it didn't work. 我试图在Eclipse服务器设置的映射部分执行此操作,但它不起作用。 When I type 当我输入

http://localhost/com/ HTTP://本地主机/ COM /

It should go to my project folder, however, when I type other folder it should use the normal website folders. 它应该转到我的项目文件夹,但是,当我键入其他文件夹时,它应该使用普通的网站文件夹。

how can I do this? 我怎样才能做到这一点?

Well I edited the apache httpd.conf file like this and it works. 好吧,我编辑了像这样的apache httpd.conf文件,它的工作原理。

#Alias for com folder
Alias /com C:\PHP\workspace-php\php_project\com
<Directory "C:\PHP\workspace-php\php_project\com">
   Options Indexes FollowSymLinks MultiViews ExecCGI
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

我在[xampp] \\ htdocs文件夹上创建了我的Eclipse工作区

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM