分类 技术 下的文章

PHP如何为函数执行设置超时

<?php
declare(ticks = 1);
function a()
{
    sleep(10);
    echo "a finishi\n";
}
function b()
{
    echo "Stop\n";
}
function c()
{
    usleep(100000);
}

function sig()
{
    throw new Exception;
}

跟踪php程序CPU100%

1.php扩展phptrace分析

https://github.com/Qihoo360/phptrace/blob/master/README_ZH.md

2.gdb命令分析

http://www.syyong.com/php/Using-strace-GDB-and-tcpdump-debugging-tools-in-PHP.html
http://rango.swoole.com/archives/325
http://rango.swoole.com/archives/340

3.使用官方提供的.gdbinit

https://phpor.net/blog/post/997