在zend studio中用XDebug调试yii项目

[debug环境 Zend Studio]

  1. 下载和安装zend studio 。
  2. File->New->Php project from existing directory, 设置项目名字。所有文件会自动映射到workspace 。
  3. 右键->项目名->Property->Resource, 把Text file encoding改为utf-8. (用container的话,可能是windows的设置,如gbk之类的)。
  4. 右键->项目名->PHP Debug->Server Settings->右边的PHP Servers->选中第一个默认选项->Edit
    Debugger设置为XDebug->OK 。
  5. 右键 项目的启动文件 index.php, Run/Debug Setting -> 选中index -> 右边一列选Edit -> 选Server卡,去掉 “Auto Generate”的勾,并填写相对于localhost的路径。
[php环境 XAMPP]
  1. 安装,并初始化一个yii项目。
  2. 在XAMPP panel中,选apache->Config->php.ini, 找到[XDebug],把注释掉的设置放开。
  3. 更改zend_extension的值为本地的php_xdebug.dll完整路径(加上盘符)。
  4. 把xdebug.remote_enable = 0改为1 。
  5. 重启apache,在phpinfo()的返回中,会有“with Xdebug v2.2.3”显示。

[说明]
如果不设置xampp的zend debugger, 也可以调试php (用internal debugger)。

[环境]
windows 8.1
xampp-win32-1.8.2-2-VC9-installer.exe
ZendStudio-10.6.1-win32.win32.x86.msi

……

Leave a Reply

Your email address will not be published. Required fields are marked *