phpstudy开启xdebug

1.找到当前运行php版本的配置文件:php.ini,比如php5.6,我的目录是

D:phpStudyPHPTutorialphpphp-5.6.27-nts

2.打开上面目录中的php.ini文件,搜索 XDebug ,会找到以下代码

[XDebug]
xdebug.profiler_output_dir="D:phpStudyPHPTutorial	mpxdebug"
xdebug.trace_output_dir="D:phpStudyPHPTutorial	mpxdebug"
;zend_extension="D:phpStudyPHPTutorialphpphp-5.6.27-ntsextphp_xdebug.dll"

默认 zend_extension 是注释的,去掉前面的注释符号,然后重启apache或者nginx.

3.测试成果,在测试文件里输出下phpinfo,成功的话会看到以下界面:

4.简单使用实例:

$name = "张三";
$name2 = $name;
xdebug_debug_zval('name');

输出:

name:
(refcount=2, is_ref=0),string '张三' (length=6)

5.php内存回收机制讲解:

http://blog.csdn.net/u011957758/article/details/76864400

原文地址:https://www.cnblogs.com/wjs2019/p/13739535.html