dongxiatuo9827 2012-11-08 10:04
浏览 77

Eclipse PDT将项目名称添加到虚拟主机路径

Can someone help me out. I run into a problem when I run a file (e.g. index.php). Every time when I want to run a file on the test server (XAMPP) Eclipse (PDT) adds the project name (e.g. testproject) after the server name (e.g. http://testproject.dev). Because I have setup a virtual host setup to automatically use a specific path (e.g. http://testproject.dev is linked to http://localhost/testproject) on the server this creates a problem. Eclipse adds the project name and then the URL becomes http://testproject.dev/testproject/index.php.

This are my configurations:

XAMPP httpd.conf (c:\xampp\conf\httpd.conf)

# Virtual hosts
Include "conf/extra/httpd-vhosts.conf"

httpd-vhosts.conf (c:\xampp\conf\extra\httpd-vhosts.conf)

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
DocumentRoot "C:/xampp/htdocs/testproject"
ServerName testproject.dev
</VirtualHost>

Windows 7 Windows vhost file (C:\Windows\System32\drivers\etc\hosts)

127.0.0.1 testproject.dev

Eclipse -> Preferences -> PHP Server

  • Tab "Server": Name: "Development_Server_Testproject" URL: http://testproject.dev

  • Tab "Path Mapping": Path on server http://testproject.dev Path in workspace

/testproject

  • 写回答

1条回答 默认 最新

  • douxiapi4381 2013-05-01 23:43
    关注

    I had a same issue with a Lamp dev server.
    It appears ridicolous but I think your problem is about the size of a window in eclipse that doesn't show all the informations.

    Try this:

    • In the tab "Path Mapping" remove the line you add
    • Go to "debug configuration" in Eclipse. On the left, expand the "PHP Web configuration" link.
    • Select the debug configuration you want to use for your project or create one if you haven't already done it.
    • Select your correct php server in the drop down menu.
    • Under the page there is a checkbox for url named "Auto generate". You have to uncheck it.
    • Under the checkbox there is a textbox to specify the url. If you didn't see it, resize your "Debug configuration" window! I spent a lot of time searching for the right options and I found that the problem is only the window size that isn't enought large to show them!
    • In the first part of the textbox now you would have http://testproject.dev, in the second part of the textbox you have /testproject/index.php. Clear the textbox.
    • You are done! Debug and enjoy.

    Hope this help

    Marco - Reteidee

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作