PHP调试利器Xdebug安装配置教程
作者:zhanhailiang 日期:2013-03-11
引用官方描述:
The Xdebug extension helps you debugging your script by providing a lot of valuable debug information.2.安装配置教程
<span class="co0" style="font-style:italic"><span style="color:#ff0000"># 下载xdebug安装包</span></span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># wget http://xdebug.org/files/xdebug-2.2.1.tgz</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># tar zxvf xdebug-2.2.1.tgz</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># cd xdebug-2.2.1/</span><span style="color:#333333"> </span><span class="co0" style="font-style:italic"><span style="color:#ff0000"># 编译安装xdebug</span></span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># phpize</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># ./configure --with-php-config=/usr/local/services/php/bin/php-config --enable-xdebug</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># make</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># sudo make install</span><span style="color:#333333">Installing shared extensions: </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">usr</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">local</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">services</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">php</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">lib</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">php</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">extensions</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">no-debug-non-zts-</span><span class="nu0" style="color:rgb(204,102,204)">20090626</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> +----------------------------------+ </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> INSTALLATION INSTRUCTIONS </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> ========================= </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> See http:</span><span class="sy0" style="color:rgb(102,204,102)">//</span><span style="color:#333333">xdebug.org</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">install.php</span><span class="co0" style="color:rgb(128,128,128); font-style:italic">#configure-php for instructions |</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> on how to </span><span class="kw3" style="color:rgb(0,0,102)">enable</span><span style="color:#333333"> Xdebug </span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> PHP. </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> Documentation is available online </span><span class="kw2" style="color:rgb(0,0,0); font-weight:bold">as</span><span style="color:#333333"> well: </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> - A list of all settings: http:</span><span class="sy0" style="color:rgb(102,204,102)">//</span><span style="color:#333333">xdebug.org</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">docs-settings.php </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> - A list of all functions: http:</span><span class="sy0" style="color:rgb(102,204,102)">//</span><span style="color:#333333">xdebug.org</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">docs-functions.php </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> - Profiling instructions: http:</span><span class="sy0" style="color:rgb(102,204,102)">//</span><span style="color:#333333">xdebug.org</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">docs-profiling2.php </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> - Remote debugging: http:</span><span class="sy0" style="color:rgb(102,204,102)">//</span><span style="color:#333333">xdebug.org</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">docs-debugger.php </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> NOTE: Please disregard the message </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> You should add </span><span class="st0" style="color:rgb(255,0,0)">"extension=xdebug.so"</span><span style="color:#333333"> to php.ini </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> that is emitted by the PECL installer. This does not work </span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> Xdebug. </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">|</span><span style="color:#333333"> +----------------------------------+linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># cp /usr/local/services/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so /usr/local/services/php/extensions/</span><span style="color:#333333"> </span><span class="co0" style="font-style:italic"><span style="color:#ff0000"># 修改php配置文件</span></span><span style="color:#333333"></span><span class="co0" style="color:rgb(128,128,128); font-style:italic">################################################################</span><span style="color:#333333">add the following line to php.ini: </span><span class="re2" style="color:rgb(0,0,255)">zend_extension</span><span style="color:#333333">=</span><span class="st0" style="color:rgb(255,0,0)">"/wherever/you/put/it/xdebug.so"</span><span style="color:#333333"> </span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> non-threaded use of PHP, </span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> example the CLI, CGI or Apache </span><span class="nu0" style="color:rgb(204,102,204)">1.3</span><span style="color:#333333"> module</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333">or: </span><span class="re2" style="color:rgb(0,0,255)">zend_extension_ts</span><span style="color:#333333">=</span><span class="st0" style="color:rgb(255,0,0)">"/wherever/you/put/it/xdebug.so"</span><span style="color:#333333"> </span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> threaded usage of PHP, </span><span class="kw1" style="color:rgb(177,177,0)">for</span><span style="color:#333333"> example the Apache </span><span class="nu0" style="color:rgb(204,102,204)">2</span><span style="color:#333333"> work MPM or the the ISAPI module</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333">. Note: In </span><span class="kw1" style="color:rgb(177,177,0)">case</span><span style="color:#333333"> you compiled PHP yourself and used </span><span class="re5" style="color:rgb(51,51,51)">--enable-debug</span><span style="color:#333333"> you would have touse </span><span class="re2" style="color:rgb(0,0,255)">zend_extension_debug</span><span style="color:#333333">=. From PHP </span><span class="nu0" style="color:rgb(204,102,204)">5.3</span><span style="color:#333333"> onwards, you always need to use thezend_extension PHP.ini setting name, and not zend_extension_ts, nor zend_extension_debug.However, your compile options </span><span class="br0" style="color:rgb(102,204,102)">(</span><span style="color:#333333">ZTS</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">normal build; debug</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">non-debug</span><span class="br0" style="color:rgb(102,204,102)">)</span><span style="color:#333333"> still need to matchwith what PHP is using.</span><span class="co0" style="color:rgb(128,128,128); font-style:italic">################################################################</span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># vim /usr/local/services/php/etc/php.ini</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># zend_extension=/usr/local/services/php/extensions/xdebug.so</span><span style="color:#333333"> </span><span class="co0" style="font-style:italic"><span style="color:#ff0000"># 检测xdebug是否加载成功(两种方法,php -m或输出phpinfo()结果)</span></span><span style="color:#333333">linux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># php -m|grep xdebug</span><span style="color:#333333">xdebuglinux-06bq:</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333"> </span><span class="co0" style="color:rgb(128,128,128); font-style:italic"># php -r "phpinfo();" |grep xdebug</span><span style="color:#333333">xdebugxdebug support =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> enabledxdebug.auto_trace =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.cli_color =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333">xdebug.collect_assignments =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.collect_includes =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.collect_params =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333">xdebug.collect_return =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.collect_vars =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.coverage_enable =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.default_enable =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.dump.COOKIE =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.ENV =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.FILES =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.GET =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.POST =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.REQUEST =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.SERVER =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump.SESSION =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.dump_globals =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.dump_once =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.dump_undefined =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.extended_info =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.file_link_format =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.idekey =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.max_nesting_level =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">100</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">100</span><span style="color:#333333">xdebug.overload_var_dump =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> On =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Onxdebug.profiler_aggregate =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.profiler_append =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.profiler_enable =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.profiler_enable_trigger =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.profiler_output_dir =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">tmp =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">tmpxdebug.profiler_output_name =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> cachegrind.out.</span><span class="sy0" style="color:rgb(102,204,102)">%</span><span style="color:#333333">p =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> cachegrind.out.</span><span class="sy0" style="color:rgb(102,204,102)">%</span><span style="color:#333333">pxdebug.remote_autostart =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.remote_connect_back =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.remote_cookie_expire_time =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">3600</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">3600</span><span style="color:#333333">xdebug.remote_enable =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.remote_handler =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> dbgp =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> dbgpxdebug.remote_host =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> localhost =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> localhostxdebug.remote_log =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no value =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> no valuexdebug.remote_mode =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> req =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> reqxdebug.remote_port =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">9000</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">9000</span><span style="color:#333333">xdebug.scream =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.show_exception_trace =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.show_local_vars =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.show_mem_delta =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.trace_enable_trigger =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Off =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> Offxdebug.trace_format =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333">xdebug.trace_options =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">0</span><span style="color:#333333">xdebug.trace_output_dir =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">tmp =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">tmpxdebug.trace_output_name =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> trace.</span><span class="sy0" style="color:rgb(102,204,102)">%</span><span style="color:#333333">c =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> trace.</span><span class="sy0" style="color:rgb(102,204,102)">%</span><span style="color:#333333">cxdebug.var_display_max_children =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">128</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">128</span><span style="color:#333333">xdebug.var_display_max_data =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">512</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">512</span><span style="color:#333333">xdebug.var_display_max_depth =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">3</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="nu0" style="color:rgb(204,102,204)">3</span><span style="color:#333333">OLDPWD =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1_SERVER</span><span class="br0" style="color:rgb(102,204,102)">[</span><span class="st0" style="color:rgb(255,0,0)">"OLDPWD"</span><span class="br0" style="color:rgb(102,204,102)">]</span><span style="color:#333333"> =</span><span class="sy0" style="color:rgb(102,204,102)">></span><span style="color:#333333"> </span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">data</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">software</span><span class="sy0" style="color:rgb(102,204,102)">/</span><span style="color:#333333">xdebug-2.2.1 </span><span class="co0" style="font-style:italic"><span style="color:#ff0000"># 最后重启服务器或php-fpm即可(根据当前服务器加载PHP模式而定)</span></span>로그인 후 복사3.测试用例
简单的测试用例如下:
<span class="kw2" style="color:rgb(0,0,0); font-weight:bold"><?php</span><span class="kw3" style="color:rgb(0,0,102)">header</span><span class="br0" style="color:rgb(102,204,102)">(</span> <span class="st_h">'X-Test: Testing'</span> <span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="kw3" style="color:rgb(0,0,102)">setcookie</span><span class="br0" style="color:rgb(102,204,102)">(</span> <span class="st0" style="color:rgb(255,0,0)">"TestCookie"</span><span class="sy0" style="color:rgb(102,204,102)">,</span> <span class="st0" style="color:rgb(255,0,0)">"test-value"</span> <span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="kw3" style="color:rgb(0,0,102)">var_dump</span><span class="br0" style="color:rgb(102,204,102)">(</span> xdebug_get_headers<span class="br0" style="color:rgb(102,204,102)">(</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>로그인 후 복사输出如下:
<span class="kw3" style="color:rgb(0,0,102)">array</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">{</span> <span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">0</span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)">=></span> string<span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">15</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="st0" style="color:rgb(255,0,0)">"X-Test: Testing"</span> <span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)">=></span> string<span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">33</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="st0" style="color:rgb(255,0,0)">"Set-Cookie: TestCookie=test-value"</span><span class="br0" style="color:rgb(102,204,102)">}</span>로그인 후 복사高级测试用例——查看变量的zval值
<span class="re0" style="color:rgb(0,0,255)">$a</span> <span class="sy0" style="color:rgb(102,204,102)">=</span> <span class="kw3" style="color:rgb(0,0,102)">array</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="sy0" style="color:rgb(102,204,102)">,</span> <span class="nu0" style="color:rgb(204,102,204)">2</span><span class="sy0" style="color:rgb(102,204,102)">,</span> <span class="nu0" style="color:rgb(204,102,204)">3</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="re0" style="color:rgb(0,0,255)">$b</span> <span class="sy0" style="color:rgb(102,204,102)">=&</span> <span class="re0" style="color:rgb(0,0,255)">$a</span><span class="sy0" style="color:rgb(102,204,102)">;</span><span class="re0" style="color:rgb(0,0,255)">$c</span> <span class="sy0" style="color:rgb(102,204,102)">=&</span> <span class="re0" style="color:rgb(0,0,255)">$a</span><span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="br0" style="color:rgb(102,204,102)">]</span><span class="sy0" style="color:rgb(102,204,102)">;</span> xdebug_debug_zval<span class="br0" style="color:rgb(102,204,102)">(</span><span class="st_h">'a'</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">;</span>로그인 후 복사输出如下:
a<span class="sy0" style="color:rgb(102,204,102)">:</span> <span class="br0" style="color:rgb(102,204,102)">(</span>refcount<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="sy0" style="color:rgb(102,204,102)">,</span> is_ref<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">=</span><span class="kw3" style="color:rgb(0,0,102)">array</span><span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">3</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">{</span> <span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">0</span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)">=></span><span class="br0" style="color:rgb(102,204,102)">(</span>refcount<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="sy0" style="color:rgb(102,204,102)">,</span> is_ref<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">0</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">=</span> int<span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)">=></span><span class="br0" style="color:rgb(102,204,102)">(</span>refcount<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="sy0" style="color:rgb(102,204,102)">,</span> is_ref<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">0</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">=</span> int<span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="br0" style="color:rgb(102,204,102)">)</span> <span class="br0" style="color:rgb(102,204,102)">[</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="br0" style="color:rgb(102,204,102)">]</span> <span class="sy0" style="color:rgb(102,204,102)">=></span><span class="br0" style="color:rgb(102,204,102)">(</span>refcount<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">2</span><span class="sy0" style="color:rgb(102,204,102)">,</span> is_ref<span class="sy0" style="color:rgb(102,204,102)">=</span><span class="nu0" style="color:rgb(204,102,204)">1</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="sy0" style="color:rgb(102,204,102)">=</span> int<span class="br0" style="color:rgb(102,204,102)">(</span><span class="nu0" style="color:rgb(204,102,204)">3</span><span class="br0" style="color:rgb(102,204,102)">)</span><span class="br0" style="color:rgb(102,204,102)">}</span>로그인 후 복사开始Xdebug之旅吧,少年!【Documentation for: Xdebug 2】
본 웹사이트의 성명본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.저자별 최신 기사
2024-10-22 09:46:29 2024-10-13 13:53:41 2024-10-12 12:15:51 2024-10-11 22:47:31 2024-10-11 19:36:51 2024-10-11 15:50:41 2024-10-11 15:07:41 2024-10-11 14:21:21 2024-10-11 12:59:11 2024-10-11 12:17:31최신 이슈PX가 REM 오류로 자동 변환 <style>html { 글꼴 크기: calc(100vw / 3.75); }body { 글꼴 크기: 0.16rem; }&l...에서 2024-04-16 09:34:16004687URL 매개변수에서 얻은 PHP 배열이 예상대로 작동하지 않습니다. 카테고리 ID가 포함된 URL 매개변수가 있고 이를 다음과 같은 배열로 처리하려고 합니다. http://example.com?cat[]=3,9,13 PHP에서는 ...에서 2024-04-06 22:09:02011428React의 정렬 메서드에서 렌더링(필터 및 페이지 매김 사용)을 트리거하는 방법은 무엇입니까? 내 Sort.js 스타일 구성 요소는 다음과 같습니다. <SortWrapper><SortText>SortBy</SortText>&...에서 2024-04-06 21:28:37012257그리드를 사용하여 특정 디자인 만들기: 단계별 가이드 이 이미지와 유사한 레이아웃을 만들려고 합니다. 이 그리드를 사용해 보았지만 그렇게 할 수 없습니다. <ulclass="container"...에서 2024-04-06 20:29:08024923단계 계층구조의 맞춤 분류를 사용하여 우커머스 관련 상품을 선택하세요. 나는 "스포츠"라는 사용자 정의 분류를 가진 wooCommerce 상점을 가지고 있습니다. 분류에는 부모, 어린이, 어린이의 세 가지 수준이 있...에서 2024-04-06 20:05:3001544