Setting up path mapping in PHP and Eclipse

本秂侑毒 提交于 2019-12-13 13:28:02

问题


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.

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

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. When I type

http://localhost/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?


回答1:


Well I edited the apache httpd.conf file like this and it works.

#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>



回答2:


I'd created my Eclipse workspace exactly on [xampp]\htdocs folder



来源:https://stackoverflow.com/questions/3028284/setting-up-path-mapping-in-php-and-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!