如何在 Eclipse 上设置 PHP 分析?
我已经在 Galileo 上设置了 Eclipse PDT。我能够运行和调试在 XAMPP 上设置的 PHP 站点。问题是,我想分析其中一个网站,但我无法弄清楚如何设置它。当我右键单击 PHP 项目时,会出现一个分析菜单,但没有指示如何从那里继续。顺便说一句,我使用 Xdebug 作为调试引擎。
I have set up Eclipse PDT on Galileo. I'm able to run and debug PHP sites that are set up on XAMPP. The thing is, I want to profile one of the sites, but cannot for the life of me figure out how to set this up. There is a profiling menu when I right-click the PHP project, but no indication of how to proceed from there. BTW I'm using Xdebug as the debug engine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了真正问题的解决方案:让 Xdebug 输出分析文件。正如@“ZZ Coder”所提到的,您实际上并不需要 Eclipse 来分析 PHP。我检查了 Xdebug 源文件,并意识到您在选项 (php.ini) 中提供的文件名格式已得到验证,并确定是否打开分析。现在这并不奇怪,但有趣的是 php.ini(随 XAMPP 1.7.2 提供)文件已经具有 Xdebug 选项:
在 Windows 上,由于两个冒号,此输出文件名格式无效,因此该选项无法验证并且分析未打开。我将其编辑为以下格式,分析开始按预期工作:
对于错误来说,似乎没有什么是神圣的:)
I came across the solution to my real problem: Getting Xdebug to output profiling files. As @"ZZ Coder" has mentioned, you don't really need Eclipse to profile PHP. I checked the Xdebug source files and realized that the filename format that you supply in the options (php.ini) gets validated and determines whether the profiling is turned on or not. Now this is not surprising, but what's interesting is that the php.ini (supplied with XAMPP 1.7.2) file already had the Xdebug option:
On Windows, this output filename format is invalid due to the two colons so the option fails validation and profiling is not turned on. I edited this to the format below and the profiling started working as expected:
Nothing is sacred when it comes to bugs it seems :)
在
php.ini
文件中设置xdebug.auto_profile = 1
。Set
xdebug.auto_profile = 1
in yourphp.ini
file.我也无法在 Eclipse 中使用 Xdebug 进行分析工作。
然而,您实际上并不需要 Eclipse 来进行分析,它几乎没有价值。一旦您在 xdebug 中打开分析,所有调试信息都会转储到临时目录中,您可以使用任何工具查看它(我更喜欢 webgrind)。
I couldn't get profiling work with Xdebug in Eclipse either.
However, you don't really need Eclipse for profiling, it has little or no value. Once you turn on the profiling in xdebug, all the debug information is dumped in a temp directory and you can just view it using any tools (I prefer webgrind).