PHPStorm+PHPStudy配置XDebug

   上一节里面从PHPStudy+PHPStorm的配置,到最后发布,PHPStorm只是承担了编辑器和发布站点的任务,但是还没有办法像Visual Studio那样对正在运行的代码进行单步调试,那么这一节就详细记录一下PHPStorm+PHPStudy XDebug的配置

    1.XDebug下载地址

        PHPStudy自带XDebug只需要执行 其他选项菜单->PHP扩展及其设置->PHP扩展->XDebug[选中]   启用Xdebug

        

        为了下载和当前PHP版本相符的Xbug版本,我们到官网https://xdebug.org/download.php

        

                       点击检测验证界面https://xdebug.org/wizard.php,复制上节中index.php 界面中输出的phpinfo()内容到验证界面

                分析结果如下

           

                        

按照界面提示:

          1.下载php_xdebug-2.6.0beta1-7.0-vc14-nts.dll

          2.把文件拷贝至D:SofrInstallphpStudyPHPTutorialphpphp-7.0.12-ntsext[这里是PHPStudy的PHP安装路径]

          3.更新文件 D:SofrInstallphpStudyPHPTutorialphpphp-7.0.12-ntsphp.ini 并且将zend_extension替换成:

            zend_extension = D:SofrInstallphpStudyPHPTutorialphpphp-7.0.12-ntsextphp_xdebug-2.6.0beta1-7.0-vc14-nts.dll

           4.重启Web服务(我们这里PHPStudy[apache])  

             D:SofrInstallphpStudyPHPTutorialphpphp-7.0.12-ntsphp.iniXdebug配置节最终的结果是: 

             [XDebug]
             xdebug.profiler_output_dir="D:SofrInstallphpStudyPHPTutorial	mpxdebug"
             xdebug.trace_output_dir="D:SofrInstallphpStudyPHPTutorial	mpxdebug"
             zend_extension = D:SofrInstallphpStudyPHPTutorialphpphp-7.0.12-ntsextphp_xdebug-2.6.0beta1-7.0-vc14-nts.dll
             xdebug.remote_enable = 1
             xdebug.remote_port=8001
             xdebug.idekey = PHPSTORM 
          如果配置成功,在localhost/phpinfo()页面中可以搜索到Xdebug的配置信息:

                             

                      2.配置PHPStorm

                         2.1 File->Settings->Languages&Frameworks->PHP->Debug

                           

                          2.2 File->Settings->Languages&Frameworks->PHP->Debug->DBGp Proxy

                         

                         2.3 File->Settings->Languages&Frameworks->PHP->Debug->Servers

                          

                          2.4 Run-> Edit Configurations...->+->PHP Web Page

                                

                         2.5保存配置,在PHPStorm index.php中打上断点,点击小虫,开启单点调试模式

                         

原文地址:https://www.cnblogs.com/andayhou/p/8269020.html