使用Eclipse创建和调试PHP代码

时间:2011-11-17 14:05:33

标签: php eclipse debugging eclipse-plugin xampp

我有xampp里面有wordpress。我还从http://download.eclipse.org/tools/pdt/updates/3.0/milestones/下载了PHP的eclipse插件。我想在eclipse(Indigo 3.7)中创建一个项目并调试我的PHP代码。有办法吗?

我尝试过加载东西。最后,我决定继续使用XDebug。我通过修改php.ini文件在PHP中配置XDebug,并通过查看phpinfo()看到它已经配置。

我已经配置了eclipse indigo来使用XDebug作为我的php调试器但是没有发生任何事情。

我遵循的步骤:

1)在eclipse中从现有位置创建了一个PHP项目 对于例如我的项目在E:\ others \ xampp-win32-1.7.7-VC9 \ xampp \ htdocs

2)修改了php.ini文件以支持xdebug并从phpinfo()方法验证。

3)配置eclipse以使用XDebug作为PHP调试器。

以下是PHP调试的样子: enter image description here

其次,PHP可执行文件: enter image description here

接下来,我认为出了什么问题!配置PHP服务器。我读到我们需要指定路径映射和东西。我没有准确地知道如何做到这一点。 enter image description here

和服务器的路径映射 enter image description here

当我尝试调试index.php文件作为PHP脚本调试时添加:它继续启动消息 启动:启动代理(24%) 并且从未完成执行。

有人可以建议缺少或需要纠正的内容吗?

XDebug的PHP.ini文件修改

  

[了XDebug]   zend_extension =“E:\ others \ xampp-win32-1.7.7-VC9 \ xampp \ php \ ext \ php_xdebug.dll”   xdebug.remote_enable = 1   xdebug.remote_host = “127.0.0.1”   xdebug.remote_port = 9000   xdebug.remote_handler = “dbgp”   xdebug.remote_mode =“req”

谢谢, Adithya。

1 个答案:

答案 0 :(得分:0)

只需将工作区设置为xampp工作文件夹(htdocs)。

您可以在eclipse中创建新项目,并通过在webbrowser中打开http://localhost/YOURPROJECTNAME来查看结果(error_reporting在xampp中默认为ON,因此您将看到错误)。