如何安装 Eclipse + PHP 开发工具 (PDT) + 2011 年 Mac 上的调试器

发布于 2024-08-25 10:18:50 字数 1067 浏览 16 评论 0原文

我在系统上安装 Eclipse 和 PDT 时遇到了很多麻烦。花了两天时间,主要是因为我能找到的所有教程都已经过时了(写于 2008 年,现在是 2011 年),而且其中包含的各种步骤不再是必要的、损坏的或不相关的。我想在这里写下我的流程,以便随着时间的推移可以对其进行改进(通过维基)。

  1. 安装没有 PHP 插件的 Eclipse(“Eclipse Classic”) 。这将为您提供一个完整的 Eclipse,我认为这是更好的选择,因为 UI 更加充实(例如,您将获得默认的透视列表,这有助于您了解透视是什么。)

  2. 使用“帮助”安装 PDT SDK > >安装新软件菜单项。您可能认为到这里就已经完成了,但是如果您尝试运行某些东西,它会因没有调试器而失败。

  3. 安装 Zend 调试器。如果您尝试使用“安装新软件”选项,它将失败,正如许多教程所建议的那样(“找不到包含 osgi.bundle.org.zend.php.debug.debugger.5.3.7.v20091116 的存储库”。)而是下载它来自 http://www.zend.com/en/community/pdt,并手动将 features/ 和 plugins/ 目录复制到 Eclipse 安装中(这些说明没有写在任何地方)。

  4. 重新启动 Eclipse

  5. Monkey 使用首选项一段时间 - 如果您遵循之前的教程并尝试手动将 php 可执行文件添加到 Eclipse 首选项 (/usr/bin/php),请将其删除(PHP > PHP 可执行文件)。将 Zend Debugger 可执行文件之一设置为默认值。如果您已经尝试执行 .php 文件,请删除您(可能不知道)创建的现有“运行”配置文件(运行 > 调试配置...)。

  6. Eclipse 工作了!您应该能够将 .php 文件作为脚本运行。

I had a lot of trouble installing Eclipse and PDT on my system. It took two days, largely because all the tutorials I could find were out of date (written in 2008, it's 2011 now) and various steps they included were no longer necessary, broken, or irrelevant. I wanted to write my process here so it could be improved upon (via wiki) as time goes on.

  1. Install Eclipse without PHP plugin ("Eclipse Classic"). This will give you a complete Eclipse, which I find preferable, as the UI is more fleshed out (e.g. you get a default list of Perspectives, which helps you understand what Perspectives are.)

  2. Install PDT SDK with the Help > Install New Software menu item. You'd think you'd be done here, but if you try to run something, it'll fail complaining of not having a debugger.

  3. Install the Zend Debugger. It'll fail if you try to use the Install New Software option, as many tutorials suggest ("No repository found containing osgi.bundle.org.zend.php.debug.debugger.5.3.7.v20091116".) Instead, download it from http://www.zend.com/en/community/pdt, and manually copy the features/ and plugins/ directory into your Eclipse install (these instructions are not written anywhere).

  4. Restart Eclipse

  5. Monkey with preferences for a while -- if you followed a previous tutorial and tried to manually add your php executable to Eclipse prefs (/usr/bin/php), remove it (PHP > PHP Executables). Set one of the Zend Debugger executables to the default. If you've already tried to execute a .php file, remove the existing "Run" profile you (maybe weren't aware that you) created (Run > Debug Configurations...).

  6. Eclipse works! You should be able to run a .php file as a script just fine.

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

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

发布评论

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

评论(4

三五鸿雁 2024-09-01 10:18:50

http://wiki.eclipse.org/PDT/Installation

我最近安装了 php 开发工具按照此 wiki 上的说明进行 eclipse 操作。希望它可以帮助任何像我一样遇到问题的人。

http://wiki.eclipse.org/PDT/Installation

I have recently installed php development tools into eclipse by following the instructions on this wiki. Hope it helps anyone who was having issues like I was.

披肩女神 2024-09-01 10:18:50

爱它。我个人强烈建议使用 Eclipse 3.3 和 PDT 1.3,并放弃新版本,直到它们齐心协力。我会帮忙,但是,我的时间有限。我发现 PDT 版本存在许多问题,因为:

  • 2.0 到 2.1 的性能很严重,使用
  • 2.1 似乎非常匆忙 - 很多偏好的
  • 2.2 似乎在构造函数等方面存在自动完成问题(阅读 中的一些开发人员评论) bug 报告也根本不会激发信心)

我还建议以与原始帖子推荐的方式大致相同的方式进行安装 - 获取 vanilla eclipse,甚至不要尝试下载 PDT 包。

此外,永远不要尝试使用 SimpleTest 插件 - 它有问题,并且在我遇到的每次安装中至少有一半的时间会失败。

或者,如果您在商业环境中工作或有闲钱,Zend Studio 基本上是 PDT 完成的......更好。

Love it. Personally I highly recommend using Eclipse 3.3 and PDT 1.3 and forgoing new versions until they get their act together. I would help out but, well, my time is limited as it is. I've found there are many issues with PDT versions since:

  • 2.0 through 2.1 had severe performance isuses
  • 2.1 seemed very rushed - lots of the prefernece
  • 2.2 seems to have issues with auto completion on constructors and the like (reading some of the developer comments in bug reports don't inspire confidence AT ALL, either)

I also recommend installing in much the same fashion as the original post recommended - get the vanilla eclipse, don't even try downloading the PDT package.

Additionally, don't ever try using the SimpleTest plugin - it's buggy and fails at least half the time on every install I've ever encountered.

Alternatively, if you work in a business environment or have money to spare, Zend Studio is basically PDT done... better.

坚持沉默 2024-09-01 10:18:50

一种可能的方法是假设现在是 2008 年,并下载编写说明时最新的所有软件包。我至少能够让 PHP CLI 调试器以这种方式工作,但仍然无法调试 PHP 网页。

我不认为你的问题是 Mac 特有的。我有维斯塔。

One possible approach is to pretend it's 2008 and download all the packages that were current at the time the instructions were written. I was able to get at least the PHP CLI debugger to work this way, but still no luck with debugging of PHP Web pages.

I don't think your problem specific to Mac. I have Vista.

流年已逝 2024-09-01 10:18:50

我在运行 PDT 和 Zend Debugger CLI 时没有遇到任何问题...我可以很好地调试 PHP(只要我作为脚本进行调试并且不尝试路由到 Web 服务器){我在 Mac 上}。

我已经尝试过路径工具等...但当我尝试路由到浏览器时 - 我得到服务器找不到页面响应...请注意,当我“测试调试”时,Zend 响应一切都是“ a-ok” - 但即便如此,我也无法通过 Web 服务器路由项目 php 文件。

我认为这要么与路径相关,要么与 Mac 10.6 上的安全性有关,

有人知道吗?

I had no problems getting PDT and Zend Debugger CLI to run ... I can debug PHP just fine (so long as I debug as script and do not try to route to the web server) {I'm on Mac}.

I've tried the path tools, etc ... and still when I try to route to the browser - I get a server can't find page response ... note that when I "test debug" Zend responds that everything is "a-ok" - but even with that, I can't a project php file to route through the web server.

I'm thinking it's either path related, or somehow security on Mac 10.6

anyone got an idea?

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