Eclipse PDT,如何设置“运行配置”?

发布于 2024-10-23 23:27:33 字数 492 浏览 1 评论 0原文

Eclipse PDT 非常灵活,但这是我的问题,回复:启动器(运行配置)

我试图在我的本地计算机(带有 WAMP 堆栈)上保持一切非常干净、简洁,并且我配置了许多虚拟主机,我的网址很容易使用。
在 eclipse 中,我设置了 PHP 服务器来与这些 Vhost 相对应。

由于我有现有代码,因此我通常“从现有源”设置一个新项目。
然后,当我尝试“运行”时,我会像这样自动生成 URL;其中包含项目名称: http://MyVhost/MyProj/testing.php

我真正想要的是: http://MyVhost/testing.php

我发现自己对服务器和运行配置进行了大量编辑和调整,然后我才能获得有效的 URL。有什么建议吗?

Eclipse PDT is very slick, but here's my issue, Re: Launcher (run configurations)

I'm trying to keep things very clean, concise on my local machine (with WAMP stack) and I have a number of virtual hosts configured, that keep my URL's easy to use.
In eclipse, I set up PHP servers to correspond with these Vhosts.

Since I have existing code, I'm usually setting up a new project 'from existing sources'.
Then when I try to 'run', I get URL auto-generated like this; with the Project name in it:
http://MyVhost/MyProj/testing.php

And what I really want is:
http://MyVhost/testing.php

I find myself doing a lot of editing and adjusting of the servers and run configurations, before I can get the URL that works. Any recommendations ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

错爱 2024-10-30 23:27:34

您可以创建一个新的运行配置 Run->Run Configurations,只要您将虚拟热点设置为服务器,您就可以取消选中 URL 下的“自动生成”选项,并为每个配置手动输入 URL项目。因此,即使您指向项目中的不同文件,也没关系,因为 Eclipse 将使用您手动输入的 URL。保存这些,然后就完成了!

You can create a new Run Configuration Run->Run Configurations and as long as you have setup your virtual hots as servers, you can untick 'Auto Generate' option under URL and enter you URL manually for each project. So even if you point to different files in your project, it won't matter because Eclipse will use your manually entered URL. Save these and then you're done!

树深时见影 2024-10-30 23:27:34

自动生成的 URL 的路径部分是基本路径(默认为 / + 项目名称)+ 项目位置内的文件路径。您可以在Project | 中将Base Path 设置为/。属性 |调试。它也适用于运行配置。如果您始终使用站点的文档根目录作为项目位置,它将起作用。

The path part of the autogenerated URL is the Base Path (which defaults to / + project name) + the path of the file inside the project location. You can set the Base Path to / in Project | Properties | Debug . It applies to Run configurations as well. If you always use the documentroot of the site as the project location, it will work.

旧话新听 2024-10-30 23:27:34

我遇到了类似的情况,如果我有一个名为“test”的虚拟主机,我想运行该项目的所有内容...

http://test/<whatever_else>/

这是我解决它的三步方法,尽管我不确定除了zend 调试器不工作。

  1. 从 Eclipse 中,转至 Windows/Preferences
  2. 转至 PHP/PHP Servers
  3. 将默认 PHP Web 服务器从 http://localhost 更改为 http://localhost

如果您让它自动生成,该项目将附加第二个斜杠和您的项目名称。

希望对某人有帮助。对我帮助很大。

I ran across something similar where if I had a vhost named "test" I wanted to run everything for that project as...

http://test/<whatever_else>/

Here is my 3 step how-to to solve it, though I am not sure of any unintended consequences other than zend debugger not working.

  1. From Eclipse, go to Windows/Preferences
  2. Go to PHP/PHP Servers
  3. Change Default PHP Web Server from http://localhost to http:/

The project will append the second slash and your project name if you just let it auto-generate.

Hope that helps someone. Helped me a ton.

番薯 2024-10-30 23:27:34

您可以修改 org.eclipse.php.server.ui 插件以按照您想要的方式获得它。

使用Eclipse的Plugin devlopment视角来修改插件。这些对话框位于

  • /org.eclipse.php.server.ui/src/org/eclipse/php/internal/server/ui/launching/PHPWebPageLaunchShortcut.java
  • /org.eclipse.php.server.ui/src/org/ eclipse/php/internal/server/ui/ServerLaunchConfigurationTab.java

显示需要在 PDT 插件 JAR 中修改的 Java 文件的动画
https://vsubhash.wordpress.com/2013/01/26/fix-for-url-auto-generate-bug-in-eclipse-php-pdt-plugin/

You can modify the org.eclipse.php.server.ui plugin to get it the way you want.

Use the Plugin devlopment perspective of Eclipse to modify the plugin. The dialogs are available in

  • /org.eclipse.php.server.ui/src/org/eclipse/php/internal/server/ui/launching/PHPWebPageLaunchShortcut.java
  • /org.eclipse.php.server.ui/src/org/eclipse/php/internal/server/ui/ServerLaunchConfigurationTab.java

Animation showing Java files that need to be modified in the PDT plugin JAR
https://vsubhash.wordpress.com/2013/01/26/fix-for-url-auto-generate-bug-in-eclipse-php-pdt-plugin/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文