我使用的是chrome和mozilla。我的编辑器是Notepad++。我只是试着为php设置一个调试器。我已经关注了这个链接和这个链接
我是从SO的答案中找到的。我的步骤是
Downloaded `php_xdebug-2.3.2-5.6-vc11-x86_64.dll` and placed inside `php'ext`.
Added the following lines in `php.ini`
zend_extension=php_xdebug-2.3.2-5.5-vc11-x86_64.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey=default
xdebug.remote_log="c:'temp'xdebug'xdebug.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.profiler_enable = 1
xdebug.profiler_output_dir ="c:'temp'xdebug"
在temp
中创建了xdebug
文件夹。我的系统是windows 64位的。Php版本为5.6.2。[重新启动Apache-无错误]
Then downloaded DBGp plugin and placed dll file inside plugins directory of Notepad++;
[Restarted Npp]
plugins->DBGp -> Config
127.0.0.1 EMPTY htdocspath htdocs path
htdocs路径为c:''Users''me''Server''Apach24''htdocs
设置断点并使用参数?XDEBUG_SESSION_START=debugMe
启动我的页面
但它并没有停留在我的休息点。
我该如何解决这个问题,或者我的最终目标是一步一步地调试PHP。还有其他选择吗。
我真的不确定记事本,但我在netbeans上尝试过,效果不错。
提示:我试着在实际项目中使用这个调试器和netbeans,但真诚地说,最好循序渐进。
我还在控制台中使用FirebugPHP,这个选项对我来说是最好的,因为不会干扰视图
以下链接可能会帮助您:
https://netbeans.org/kb/docs/php/debugging.html
http://wiki.netbeans.org/HowToConfigureXDebug
http://www.firephp.org/
https://enboliviacom.wordpress.com/2013/03/25/analizar-el-rendimiento-de-las-consultas-sql-en-aplicaciones-php-con-firephp/
当我在php.ini 中给出dll的完整路径时,我发现它有效
zend_extension="C:'Program Files (x86)'PHP'ext'php_xdebug-2.2.6-5.3-vc9.dll"
我认为你也在用记事本中的DBGp插件设置断点——在页边空白处显示红点。我还发现,当调试停止在该行时,显示当前行的绿色箭头位于红点下方,并不明显。
编辑:session.save_path设置的使用也会影响DBGp,它只适用于最后提到的站点。因此,请确保最后提到localhost根:
;Application xyz must keep session variables separate
[PATH=C:'inetpub'wwwroot'xyz]
session.save_path = "C:'temp'xyz"
;...etc
;Must have this for DBGp to function on all localhost sites
[PATH=C:'inetpub'wwwroot]
session.save_path = "C:'temp"