<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[个人原创]Xdebug安装配置及32位机器PHP日志文件大于2G问题异常排查，删除xdebug的多个文件的方法。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Fri, 30 Sep 2011 08:25:19 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	 xdebug.max_nesting_level=30 //这个值不能太少，尤其是核心Core.php（特别指：框架核心），30较为靠谱，否则出现如下：<br/>PHP Fatal error:&nbsp;&nbsp;Maximum function nesting level of &#039;10&#039; reached, aborting! in /data/htdocs/jackxiang.com/libraries/core.php on line 315<br/><br/>vi +315 /data/htdocs/jackxiang.com/libraries/core.php <br/>313&nbsp;&nbsp;&nbsp;&nbsp; public static function autoload ($class)<br/>314&nbsp;&nbsp;&nbsp;&nbsp; &#123;<br/>315&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (class_exists($class, FALSE))<br/><br/><textarea name="code" class="php" rows="15" cols="100">
[Xdebug]
 zend_extension=&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so&quot;
 xdebug.profiler_enable = on
 xdebug.default_enable = on
 xdebug.trace_output_dir=&quot;/data/logs/xdebug&quot;
 xdebug.trace_output_name = trace.%c.%p
 xdebug.profiler_output_dir=&quot;/data/logs/xdebug&quot;
 xdebug.profiler_output_name=&quot;cachegrind.out.%H.%u.%s&quot;
 
 xdebug.dump_once=On
 xdebug.dump_globals=On
 xdebug.dump_undefined=On&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
 
 xdebug.dump.REQUEST=*
 xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT
 
 xdebug.show_exception_trace=On
 xdebug.show_local_vars=1
 xdebug.var_display_max_depth=6
 
 xdebug.max_nesting_level=30
</textarea><br/><br/><textarea name="code" class="php" rows="15" cols="100">
&nbsp;&nbsp;&nbsp;&nbsp;cat &gt; %&#123;_prefix&#125;/etc/php.d/xdebug.ini &lt;&lt; EOF
[Xdebug]&nbsp;&nbsp;
 zend_extension=&quot;/usr/local/php/ext/xdebug.so&quot;&nbsp;&nbsp;
 xdebug.profiler_enable = on&nbsp;&nbsp;
 xdebug.default_enable = on&nbsp;&nbsp;
 xdebug.trace_output_dir=&quot;/data/logs/xdebug&quot;&nbsp;&nbsp;
 xdebug.trace_output_name = trace.%c.%p&nbsp;&nbsp;
 xdebug.profiler_output_dir=&quot;/data/logs/xdebug&quot;&nbsp;&nbsp;
 xdebug.profiler_output_name=&quot;cachegrind.out.%H.%u.%s&quot;&nbsp;&nbsp;
&nbsp;&nbsp; 
 xdebug.dump_once=On&nbsp;&nbsp;
 xdebug.dump_globals=On&nbsp;&nbsp;
 xdebug.dump_undefined=On&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp; 
 xdebug.dump.REQUEST=*&nbsp;&nbsp;
 xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT&nbsp;&nbsp;
&nbsp;&nbsp; 
 xdebug.show_exception_trace=On&nbsp;&nbsp;
 xdebug.show_local_vars=1&nbsp;&nbsp;
 xdebug.var_display_max_depth=6&nbsp;&nbsp;
&nbsp;&nbsp; 
 xdebug.max_nesting_level=30&nbsp;&nbsp;
EOF
</textarea><br/><br/>shell_exec/proc_open 两函数得打开：<br/>+-----------------------------------------------------------+<br/>&#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ! ERROR !&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;<br/>&#124; The test-suite requires that proc_open() is available.&nbsp;&nbsp;&nbsp;&nbsp;&#124;<br/>&#124; Please check if you disabled it in php.ini.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;<br/>+-----------------------------------------------------------+<br/>shell_exec() has been disabled for security reasons in /home/test/rpmbuild/BUILD/xdebug-2.7.0alpha1/run-tests.php on line 306<br/><br/><br/>xdebug模块输出文件名的配置说明，那么我可以用：<br/>xdebug.profiler_output_name = cachegrind.out.%s<br/>多个域名的话，也可以组合使用<br/>xdebug.profiler_output_name = cachegrind.out.%H.%u.%s<br/>http://blog.csdn.net/binger819623/article/details/3985506<br/><br/><br/><textarea name="code" class="php" rows="15" cols="100">
[Xdebug]
zend_extension=&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so&quot;&nbsp;&nbsp;
xdebug.profiler_enable = on&nbsp;&nbsp;
xdebug.default_enable = on&nbsp;&nbsp;
xdebug.trace_output_dir=&quot;/data/logs/xdebug&quot;&nbsp;&nbsp;
xdebug.trace_output_name = trace.%c.%p&nbsp;&nbsp;
xdebug.profiler_output_dir=&quot;/data/logs/xdebug&quot;&nbsp;&nbsp;
xdebug.profiler_output_name=&quot;cachegrind.out.%H.%u.%s&quot;&nbsp;&nbsp;

xdebug.dump_once=On&nbsp;&nbsp;
xdebug.dump_globals=On&nbsp;&nbsp;
xdebug.dump_undefined=On&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xdebug.dump.REQUEST=*&nbsp;&nbsp;
xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT&nbsp;&nbsp;

xdebug.show_exception_trace=On&nbsp;&nbsp;
xdebug.show_local_vars=1&nbsp;&nbsp;
xdebug.var_display_max_depth=6&nbsp;&nbsp;

xdebug.max_nesting_level=30
</textarea><br/><br/>删除xdebug的多个文件的方法（很多Xdebug的Log文件想通过：rm -Rf 来删除，报错: Argument list too long）：<br/>http://jackxiang.com/post/1263/<br/>三分钟一清，试过一小时一清，都3G左右大小了：<br/><textarea name="code" class="php" rows="15" cols="100">
#clear Php Xdebug&#039;s Folder Per one hour,Add By:xiangdong,2016.03.08
*/3&nbsp;&nbsp;* * * * /bin/bash /usr/local/scripts/clearXdebugFolder.sh &gt;&gt; /data/logs/xdebug/clearXdebugFolder.log 2&gt;&amp;1
</textarea><br/>chmod a+x /usr/local/scripts/clearXdebugFolder.sh<br/><br/>查找目录：find /（查找范围） -name &#039;查找关键字&#039; -type d<br/>查找文件：find /（查找范围） -name 查找关键字 -print<br/>clearXdebugFolder.sh ,一定要加type f，不加会把目录也删除了滴:<br/><textarea name="code" class="php" rows="15" cols="100">
find /data/logs/xdebug -name &quot;*&quot; -type f&#124;xargs rm -Rf
dateTime=`date +%Y%m%d%H%M%S`
echo $dateTime
</textarea><br/>sh /root/clearXdebugFolder.sh<br/>ls /data/logs/xdebug/<br/><br/>xdebug的分析GUI程序WinCacheGrind文件下载位置：<br/>http://sourceforge.net/projects/wincachegrind/files/wincachegrind/<br/>如果有安zendoptimizer：<br/>xdebug和zendoptimizer不兼容，所以在开启xdebug调试的时候请务必在php.ini里关闭zendoptimizer，如下前面加上分号即可 ;<br/><br/>Xdebug安装配置：<br/>目前版本：http://xdebug.org/files/xdebug-2.2.3.tgz<br/> wget http://xdebug.org/files/xdebug-2.2.0.tgz<br/><textarea name="code" class="html" rows="15" cols="100">
root@116.255.139.240:~/software#wget http://xdebug.org/files/xdebug-2.1.2.tgz
root@116.255.139.240:~/software/xdebug-2.1.2# /usr/local/webserver/php/bin/phpize
root@116.255.139.240:~/software/xdebug-2.1.2#./configure --enable-xdebug --with-php-config=/usr/local/webserver/php/bin/php-config
root@116.255.139.240:~/software/xdebug-2.1.2#make
root@116.255.139.240:~/software/xdebug-2.1.2# make install
Installing shared extensions:&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
NOTE: Please disregard the message&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;You should add &quot;extension=xdebug.so&quot; to php.ini&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
that is emitted by the PECL installer. This does not work for
Xdebug.&nbsp;&nbsp;&nbsp;&nbsp; 
</textarea><br/>修改PHP的配置文件：php.ini后，加入这个扩展：<br/>FastCgi重启：PHP进程.<br/>Apache常规：重启Apache。<br/><br/>问题的缘起，PHP打开错误，且安好了Xdebug，前几天还好好的 ，但是在Apache下依旧没有报错，返回空白，于是在Terminal下执行出现如下：<br/><textarea name="code" class="html" rows="15" cols="100">
#php bughave.php
</textarea><br/>出现返回如下：<br/><textarea name="code" class="html" rows="15" cols="100">File size limit exceeded</textarea><br/>查了个Google网上说是某日志文件太大，估计是大于2G了，于是，从Php的日志文件查起，一看，果然有一个：<br/><textarea name="code" class="html" rows="15" cols="100">
log_errors = On
error_log = /tmp/phpSys.log
</textarea><br/>如此，查看一下大小：<br/><textarea name="code" class="html" rows="15" cols="100">
/home/admin/php # du -sh /tmp/phpSys.log
2.1G&nbsp;&nbsp;&nbsp;&nbsp;/tmp/phpSys.log
</textarea><br/>果然太大了，于是删除。<br/>其实还可以这样查的，用Awk遍历某个你认为日志的目录：<br/><textarea name="code" class="html" rows="15" cols="100">
find . -name &quot;*&quot; &#124;du -sh *&#124;awk &#039;&#123;if(match($1, &quot;G&quot;)&gt;0) print $0 &#125;&#039; 
</textarea><br/>我的Vps下的Nignx目录日志扫描：<br/><textarea name="code" class="html" rows="15" cols="100">
root@116.255.139.240:/data1/logs#&nbsp;&nbsp;&nbsp;&nbsp; find . -name &quot;*&quot; &#124;du -sh *&#124;awk &#039;&#123;if(match($1, &quot;G&quot;)&gt;0) print $0 &#125;&#039;
5.0G&nbsp;&nbsp;&nbsp;&nbsp;access.log
</textarea><br/><br/>解决办法：先删除再说，后加入Crontab定时删除PHP的错误Log文件：<br/><textarea name="code" class="html" rows="15" cols="100">
* 15 * * * /home/jackxiang/crontab_shell_folder/auto_clean_mysql_query.sh &gt; /dev/null 2&gt;&amp;1
</textarea><br/>文件内容：<br/><textarea name="code" class="html" rows="15" cols="100">
cat /home/jackxiang/crontab_shell_folder/auto_clean_mysql_query.sh
echo &quot;&quot; &gt; /tmp/discuz.log
</textarea><br/>加入执行权限：<br/><textarea name="code" class="html" rows="15" cols="100">
chmod 777 /home/jackxiang/crontab_shell_folder/auto_clean_mysql_query.sh
</textarea><br/><br/><br/><br/>总结：其实从终端就可以看出是一个Log太大引起的问题，以后得注意这样的大文件要定时给清理下，但也不能全给干掉，<br/>有时调试错误时也是很有帮助的，于是否，我们尽管引入了这个xdebug，如下配置：<br/><textarea name="code" class="html" rows="15" cols="100">
zend_extension=&quot;/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so&quot;
xdebug.profiler_enable = on
xdebug.default_enable = on
xdebug.trace_output_dir=&quot;/data/logs/xdebug&quot;
xdebug.trace_output_name = trace.%c.%p
xdebug.profiler_output_dir=&quot;/data/logs/xdebug&quot;
xdebug.profiler_output_name=&quot;cachegrind.out.%s&quot;
xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT
</textarea><br/><br/>要想加入get变量调试需要加入：<br/><textarea name="code" class="html" rows="15" cols="100">
xdebug.dump_once=On
xdebug.dump_globals=On
xdebug.dump_undefined=On
xdebug.dump.REQUEST=*
xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT
</textarea><br/>加入跟踪加入：<br/><textarea name="code" class="html" rows="15" cols="100">
xdebug.show_exception_trace=On
xdebug.show_local_vars=1
xdebug.var_display_max_depth=6
</textarea><br/>最大循环次数：<br/><textarea name="code" class="html" rows="15" cols="100">
xdebug.max_nesting_level=50
</textarea><br/><br/>最后，由上面的配置综合出我自己的配置如下：<br/><textarea name="code" class="html" rows="15" cols="100">
 [Xdebug]
 zend_extension=&quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so&quot;
 xdebug.profiler_enable = on
 xdebug.default_enable = on
 xdebug.trace_output_dir=&quot;/data/logs/xdebug&quot;
 xdebug.trace_output_name = trace.%c.%p
 xdebug.profiler_output_dir=&quot;/data/logs/xdebug&quot;
 xdebug.profiler_output_name=&quot;cachegrind.out.%s&quot;
 ;add by jack get post variables
 xdebug.dump_once=On
 xdebug.dump_globals=On
 xdebug.dump_undefined=On
 xdebug.dump.REQUEST=*
 xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT
 ;add by jack trance variables
 xdebug.show_exception_trace=On
 xdebug.show_local_vars=1
 xdebug.var_display_max_depth=6
 ;loop times as 30
 xdebug.max_nesting_level=30
</textarea><br/><br/>新加参考：http://www.searchtb.com/2010/12/using-xdebug-to-improve-performance.html<br/><br/>特别注意，如果出现这个错误,如果出现下列提示<br/>PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0 <br/> 先把这一行注释掉，<br/>;extension=xdebug.so<br/>然后，学学习上面这样：zend_extension=&quot;/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so&quot;<br/>否则就老是会报这个Warning，听说是和php 的PHP ZTS 有关系，参考：http://www.dnaphp.com/php/php-core/505<br/>整个循环又有get又有post的错误出来，截取错误分析如下：<br/><textarea name="code" class="html" rows="15" cols="100">
array
&nbsp;&nbsp;&#039;name&#039; =&gt; string &#039;jack&#039; (length=4)
&nbsp;&nbsp;&#039;sex&#039; =&gt; string &#039;man&#039; (length=3)
//xdebug对一些PHP函数做了重写，上面这个通过var_dump输出数组时有颜色标记，还有长度，比常规var_dump好。
......
28&nbsp;&nbsp;0.0006&nbsp;&nbsp;57864&nbsp;&nbsp;php100_fun( )&nbsp;&nbsp;../myProcess.php:3
29&nbsp;&nbsp;0.0006&nbsp;&nbsp;57952&nbsp;&nbsp;php100_fun( )&nbsp;&nbsp;../myProcess.php:3&nbsp;&nbsp;&nbsp;&nbsp;//果然只有29次循环
Dump $_SERVER
$_SERVER[&#039;REQUEST_METHOD&#039;] = &#039;POST&#039; (length=4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Post方法
$_SERVER[&#039;REQUEST_URI&#039;] = &#039;/php/cgi/myProcess.php?gjj=468&#039; (length=33) //URI链接
$_SERVER[&#039;HTTP_USER_AGENT&#039;] =&#039;curl/7.17.0 (i586-pc-mingw32msvc) libcurl/7.17.0 zlib/1.2.2&#039; (length=59) //请求Agent头，我用的CURL
Dump $_REQUEST //相关于Php的REQUEST
$_REQUEST[&#039;gjj&#039;] = &#039;468&#039; (length=3)&nbsp;&nbsp;//get 参数
$_REQUEST[&#039;domainlist&#039;] =array&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Post数组
&nbsp;&nbsp;&nbsp;&nbsp; &#039;domain&#039; =&gt; string &#039;testdd.oa.com&#039; (length=13)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#039;ip&#039; =&gt; string &#039;172.25.39.74&#039; (length=12)
.......
.......
</textarea><br/>注意：remote_host应该填写远程调试机的地址，而不是PHP服务器的地址，在Xdebug运行方式下，调试工具实际是调试过程的服务端，Xdebug会主动连接指定的remoete_host，从而建立调试通讯。所以要注意调试机的防火墙问题<br/>但是它也不是万能的，在调试我们的接口时返回一串html的table如下：<br/><textarea name="code" class="html" rows="15" cols="100">
td bgcolor=&#039;#eeeeec&#039; align=&#039;center&#039;&gt;1&lt;/td&gt;&lt;td bgcolor=&#039;#eeeeec&#039; align=&#039;center&#039;&gt;0.0007&lt;/td&gt;&lt;td bgcolor=&#039;#eeeeec&#039; align=&#039;right&#039;&gt;74992&lt;/td&gt;&lt;td bgcolor=&#039;#eeeeec&#039;&gt;&#123;mai
public_html/pms_proj/trunk/php/cgi/buildProcess.php&#039; bgcolor=&#039;#eeeeec&#039;&gt;../buildProcess.php&lt;b&gt;
</textarea><br/>这样是不利于接口调试的，于是能通过：<br/>tail -f /tmp/phpSys.log来及时获取错误情况，xdebug对页面返回的调试很好，但对接口调试返回时是串不方便，同时在外网时也可能通过日志文件了解下情况，蛤发现好像这两个没法结合起来，但xdebug对这个性能分析上还是很不错的如下：<br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
function php100_fun()&#123;
php100_fun();
&#125;
php100_fun();
?&gt;
</textarea><br/><br/># php php100.php&nbsp;&nbsp;<br/>Fatal error: Maximum function nesting level of &#039;100&#039; reached, aborting! in /data/home/admin/php/php100.php on line 3<br/>Call Stack:<br/>&nbsp;&nbsp;&nbsp;&nbsp;0.0006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57188&nbsp;&nbsp; 1. &#123;main&#125;() /data/home/admin/php/php100.php:0<br/>&nbsp;&nbsp;&nbsp;&nbsp;0.0006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57236&nbsp;&nbsp; 2. php100_fun() /data/home/admin/php/php100.php:5<br/>&nbsp;&nbsp;&nbsp;&nbsp;......<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;0.0006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;68268&nbsp;&nbsp;97. php100_fun() /data/home/admin/php/php100.php:3<br/>&nbsp;&nbsp;&nbsp;&nbsp;0.0006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;68356&nbsp;&nbsp;98. php100_fun() /data/home/admin/php/php100.php:3<br/>&nbsp;&nbsp;&nbsp;&nbsp;0.0006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;68444&nbsp;&nbsp;99. php100_fun() /data/home/admin/php/php100.php:3<br/><br/>注意：最大执行循环次数100次，在这儿，是php的xdebug限定的次数，这个变量可以设置：xdebug.max_nesting_level=50;//最大循环次数，防止死循环，还有这个也是经常用的：xdebug.dump.SERVER=REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENT<br/><br/>如果出现&quot;File Size Limit Exceeded&quot;的错误,请先检查下你应用程序的相关日志,查看下你的日志是否很大,如果很大的话,这个就是&quot;File Size Limit Exceeded&quot; 问题出现的原因.<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 建议:<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 1. 前期规划的时候考虑到日志问题,建议按照年月日进行日志的分类.<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 2. 对于日志不是很重要,往往很多朋友都是把日志丢到&quot;黑洞&quot;里去,但是往往排错的时候就发现没有日志可供分析,所以建议各位不要把日志丢到黑洞里去;<br/><br/> <br/><br/>备注:<br/><br/>关于ulimit的命令:<br/><br/>1,说明:<br/>ulimit用于shell启动进程所占用的资源.<br/>2,类别:<br/>shell内建命令<br/>3,语法格式:<br/>ulimit [-acdfHlmnpsStvw] [size]<br/><br/>4,参数介绍:<br/><br/>-H 设置硬件资源限制.<br/>-S 设置软件资源限制.<br/>-a 显示当前所有的资源限制.<br/>-c size:设置core文件的最大值.单位:blocks<br/>-d size:设置数据段的最大值.单位:kbytes<br/>-f size:设置创建文件的最大值.单位:blocks<br/>-l size:设置在内存中锁定进程的最大值.单位:kbytes<br/>-m size:设置可以使用的常驻内存的最大值.单位:kbytes<br/>-n size:设置内核可以同时打开的文件描述符的最大值.单位:n<br/>-p size:设置管道缓冲区的最大值.单位:kbytes<br/>-s size:设置堆栈的最大值.单位:kbytes<br/>-t size:设置CPU使用时间的最大上限.单位:seconds<br/>-v size:设置虚拟内存的最大值.单位:kbytes 5<br/><br/>值得参考：http://www.alixixi.com/program/a/2011030368167.shtml<br/>配套视频和对应PPT：<br/>PPT：http://wenku.baidu.com/view/ba064e212f60ddccda38a05c.html<br/>视屏：http://v.youku.com/v_show/id_XMjQ5OTA1MTIw.html
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [个人原创]Xdebug安装配置及32位机器PHP日志文件大于2G问题异常排查，删除xdebug的多个文件的方法。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>