2011年如何在Mac上安装Eclipse + PHP Development Tools (PDT) + Debugger
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2451671/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install Eclipse + PHP Development Tools (PDT) + Debugger on Mac in The Year 2011
提问by duozmo
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.
在我的系统上安装 Eclipse 和 PDT 时遇到了很多麻烦。花了两天时间,主要是因为我能找到的所有教程都过时了(写于 2008 年,现在是 2011 年),并且它们包含的各个步骤不再必要、损坏或无关紧要。我想在这里写下我的流程,以便随着时间的推移(通过 wiki)对其进行改进。
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.)
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.
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).
Restart Eclipse
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...).
Eclipse works! You should be able to run a .php file as a script just fine.
在没有 PHP 插件的情况下安装 Eclipse (“ Eclipse Classic”)。这将为您提供一个完整的 Eclipse,我认为它更可取,因为 UI 更加充实(例如,您将获得一个默认的透视图列表,这有助于您了解透视图是什么。)
使用帮助 > 安装新软件菜单项安装 PDT SDK。您会认为到这里就大功告成了,但是如果您尝试运行某些东西,它会抱怨没有调试器而失败。
安装 Zend 调试器。如果您尝试使用安装新软件选项,它将失败,正如许多教程所建议的那样(“找不到包含 osgi.bundle.org.zend.php.debug.debugger.5.3.7.v20091116 的存储库”。)相反,下载它来自http://www.zend.com/en/community/pdt,并手动将 features/ 和 plugins/ 目录复制到您的 Eclipse 安装中(这些说明没有写在任何地方)。
重启 Eclipse
Monkey 有一段时间的偏好 -- 如果您遵循了之前的教程并尝试将您的 php 可执行文件手动添加到 Eclipse 首选项 (/usr/bin/php),请将其删除 (PHP > PHP Executables)。将 Zend Debugger 可执行文件之一设置为默认值。如果您已经尝试执行 .php 文件,请删除您(可能不知道您)创建的现有“运行”配置文件(运行 > 调试配置...)。
日食有效!您应该能够将 .php 文件作为脚本运行就好了。
回答by Andrew Chinn
http://wiki.eclipse.org/PDT/Installation
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.
我最近按照此 wiki 上的说明将 php 开发工具安装到 eclipse 中。希望它可以帮助任何像我一样遇到问题的人。
回答by spronkey
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:
爱它。我个人强烈建议使用 Eclipse 3.3 和 PDT 1.3 并放弃新版本,直到它们一起行动。我会帮忙,但是,我的时间是有限的。我发现 PDT 版本存在很多问题,因为:
- 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)
- 2.0 到 2.1 有严重的性能问题
- 2.1 似乎很匆忙 - 很多偏好
- 2.2 似乎在构造函数等方面存在自动完成问题(阅读错误报告中的一些开发人员评论也根本无法激发信心)
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.
我还建议以与推荐的原始帖子大致相同的方式进行安装 - 获取 vanilla eclipse,甚至不要尝试下载 PDT 包。
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.
此外,永远不要尝试使用 SimpleTest 插件 - 它有问题,并且在我遇到的每次安装中至少有一半的时间失败。
Alternatively, if you work in a business environment or have money to spare, Zend Studio is basically PDT done... better.
或者,如果您在商业环境中工作或有闲钱,Zend Studio 基本上是 PDT 完成的……更好。
回答by Alex R
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.
一种可能的方法是假装它是 2008 年并下载编写说明时最新的所有软件包。我至少可以让 PHP CLI 调试器以这种方式工作,但在调试 PHP 网页时仍然没有运气。
I don't think your problem specific to Mac. I have Vista.
我不认为您的问题特定于 Mac。我有Vista。
回答by Robert
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}.
我在运行 PDT 和 Zend Debugger CLI 时没有任何问题......我可以很好地调试 PHP(只要我作为脚本调试并且不尝试路由到 Web 服务器){我在 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.
我已经尝试了路径工具等......但当我尝试路由到浏览器时 - 我得到服务器找不到页面响应......请注意,当我“测试调试”时,Zend 响应一切都是“ a-ok” - 但即便如此,我也无法通过 Web 服务器路由项目 php 文件。
I'm thinking it's either path related, or somehow security on Mac 10.6
我认为它要么与路径相关,要么与 Mac 10.6 上的安全性有关
anyone got an idea?
有人有想法吗?

