{"id":92,"date":"2016-12-06T18:20:31","date_gmt":"2016-12-06T10:20:31","guid":{"rendered":"http:\/\/xlight.me\/blog\/?p=92"},"modified":"2017-01-17T08:51:54","modified_gmt":"2017-01-17T00:51:54","slug":"xhprof%e5%ae%89%e8%a3%85%ef%bc%8c%e9%85%8d%e7%bd%ae%ef%bc%8c%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/xlight.me\/blog\/2016\/12\/xhprof%e5%ae%89%e8%a3%85%ef%bc%8c%e9%85%8d%e7%bd%ae%ef%bc%8c%e4%bd%bf%e7%94%a8\/","title":{"rendered":"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528"},"content":{"rendered":"<h2>\u7b2c\u4e00\u9636\u6bb5\uff1a\u751f\u6210profile\u6587\u4ef6<\/h2>\n<h3><a name=\"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528-\u5b89\u88c5\"><\/a>\u5b89\u88c5<\/h3>\n<ul>\n<li>pecl install channel:\/\/pecl.php.net\/xhprof-0.9.2 \uff08\u76ee\u524d\u662fBeta\u7248\uff09\uff0c<\/li>\n<li>\u5982\u679c\u4e0d\u80fd\u76f4\u63a5install\uff0c\u5219\u53ef\u4ee5 pecl download\u4e0b\u6765\u540e\uff0cphpize &amp;&amp; .\/configure &amp;&amp; make &amp;&amp; make install<\/li>\n<li>\u7f16\u8f91php.ini \u6dfb\u52a0\u5982\u4e0b\n<div>\n<div>\n<div id=\"highlighter_499686\">\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>extension=xhprof.so<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>;Path to store xhprof file,<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>;\u9700\u8981\u5b9a\u671f\u6e05\u7406<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>;\u6ce8\u610f\u521b\u5efa\u8def\u5f84\u548c\u6743\u9650<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>xhprof.output_dir=<\/code><code>\"\/logs\/xhprof\"<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<h3><a name=\"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528-\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u542f\u7528\"><\/a>\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u542f\u7528<\/h3>\n<ul>\n<li>\/home\/xLight\/php\/lib\/prepend.php:\n<div>\n<div>\n<div id=\"highlighter_672207\">\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>&lt;?php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/* \u542f\u52a8xhprof\uff0c\u4e07\u5206\u4e4b\u4e00\u6982\u7387<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>if<\/code><code>(mt_rand(<\/code><code>1<\/code><code>,\u00a0<\/code><code>10000<\/code><code>)==<\/code><code>1<\/code>\u00a0<code>&amp;&amp; function_exists(<\/code><code>'xhprof_enable'<\/code><code>) )<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>{<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>xhprof_enable(XHPROF_FLAGS_MEMORY);<\/code><code>\/\/XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY\u00a0 ,\u5b98\u65b9\u4e0d\u5efa\u8bae\u5728\u751f\u4ea7\u73af\u5883\u5f00\u542fXHPROF_FLAGS_CPU<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>define('XHPROF_ON',true);<\/code><code>\/\/\u6807\u8bb0<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/\u5b9a\u4e49\u8f93\u51faprofile\u6587\u4ef6\u7684\u89c4\u5219<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>define(<\/code><code>'XHPROF_TIMELIMIT'<\/code><code>,\u00a0<\/code><code>10<\/code><code>);<\/code><code>\/\/\u8bb0\u5f55\u6267\u884c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u7684\u3002\u5355\u4f4d\uff1a\u79d2<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>define(<\/code><code>'XHPROF_MEMLIMIT'<\/code><code>,\u00a0<\/code><code>50<\/code><code>);<\/code><code>\/\/\u8bb0\u5f55\u5185\u5b58\u4f7f\u7528\u8d85\u8fc7\u8fd9\u4e2a\u91cf\u7684\u3002\u5355\u4f4d\uff1aM<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/define('XHPROF_DIR', '\/'.date('Ymd_H') );\u00a0 \/\/\u5f00\u542f\u672c\u884c\u5219\u542f\u7528\u81ea\u5df1\u7684\u6309\u65f6\u95f4\u62c6\u5206\u8def\u5f84\u903b\u8f91<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>register_shutdown_function('xhprof_save');<\/code> \/\/die\u5f3a\u884c\u7ec8\u6b62\u7684\u7a0b\u5e8f\u4e5f\u4f1a\u6709\u8bb0\u5f55<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>}<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/*\/<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li>\/home\/xLight\/php\/lib\/append.php:\n<div>\n<div>\n<div id=\"highlighter_683085\">\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>function xhprof_save(){<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/* \u7ed3\u675f xhprof\u5e76\u4fdd\u5b58<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>if<\/code><code>(!XHPROF_ON)\u00a0<\/code><code>return<\/code><code>;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/ stop profiler<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$xhprof_data = xhprof_disable();<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/\u8bb0\u5f55\u6267\u884c\u65f6\u95f4\u5927\u4e8et\u79d2 \u6216\u5185\u5b58\u5360\u7528\u5927\u4e8em\u5146<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>if<\/code><code>($xhprof_data[<\/code><code>'main()'<\/code><code>][<\/code><code>'wt'<\/code><code>] &lt; XHPROF_TIMELIMIT *<\/code><code>1000000<\/code>\u00a0<code>&amp;&amp; $xhprof_data[<\/code><code>'main()'<\/code><code>][<\/code><code>'mu'<\/code><code>] &lt; XHPROF_MEMLIMIT *<\/code><code>1000000<\/code><code>)\u00a0<\/code><code>return<\/code><code>;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/parameter \"source\" for UI<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$source = $_SERVER[<\/code><code>'HTTP_HOST'<\/code><code>].<\/code><code>'__'<\/code><code>;<\/code><code>\/\/add host<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$source .= $_SERVER[<\/code><code>'REQUEST_URI'<\/code><code>] ? $_SERVER[<\/code><code>'REQUEST_URI'<\/code><code>] : $_SERVER[<\/code><code>'SCRIPT_FILENAME'<\/code><code>];\u00a0<\/code><code>\/\/add script<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$source = str_replace(array(<\/code><code>'\/'<\/code><code>,<\/code><code>'.'<\/code><code>,<\/code><code>'&amp;'<\/code><code>,<\/code><code>'?'<\/code><code>,<\/code><code>'='<\/code><code>),<\/code><code>'_'<\/code><code>,$source);<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/parameter \"run\" for UI<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$run = str_pad((<\/code><code>int<\/code><code>)($xhprof_data[<\/code><code>'main()'<\/code><code>][<\/code><code>'wt'<\/code><code>]\/<\/code><code>1000000<\/code><code>),\u00a0<\/code><code>4<\/code><code>,\u00a0<\/code><code>\"0\"<\/code><code>, STR_PAD_LEFT);<\/code><code>\/\/ \u7a0b\u5e8f\u6267\u884c\u79d2\u6570\uff0c\u6269\u5c55\u62104\u4f4d\uff0c\u524d\u9762\u88650<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$run .=\u00a0<\/code><code>'_'<\/code><code>.str_pad((<\/code><code>int<\/code><code>)($xhprof_data[<\/code><code>'main()'<\/code><code>][<\/code><code>'mu'<\/code><code>]\/<\/code><code>1000000<\/code><code>),\u00a0<\/code><code>4<\/code><code>,\u00a0<\/code><code>\"0\"<\/code><code>, STR_PAD_LEFT);<\/code><code>\/\/ \u7a0b\u5e8f\u5360\u7528\u5185\u5b58\uff0c\u6269\u5c55\u62104\u4f4d\uff0c\u524d\u9762\u88650<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\/\/ dir for save file<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$dir = $XHPROF_DIR ? $XHPROF_DIR :\u00a0<\/code><code>''<\/code><code>;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$FullDir = ini_get(<\/code><code>'xhprof.output_dir'<\/code><code>).<\/code><code>'\/'<\/code><code>.$dir;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>if<\/code><code>($dir &amp;&amp; !file_exists($FullDir))<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0<\/code><code>@mkdir<\/code><code>( $FullDir ,\u00a0<\/code><code>0777<\/code>\u00a0<code>,<\/code><code>true<\/code><code>);<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>$FullPath = $FullDir.<\/code><code>'\/'<\/code><code>.$run.<\/code><code>'.'<\/code><code>.$source ;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>file_put_contents($FullPath , serialize($xhprof_data));<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>}\/\/*\/<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li>\u7f16\u8f91php.ini\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\n<div>\n<div>\n<div id=\"highlighter_271046\">\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>auto_prepend_file =\u00a0<\/code><code>\"\/home\/xLight\/php\/lib\/prepend.php\"<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ul>\n<h2><a name=\"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528-\u7b2c\u4e8c\u9636\u6bb5\uff1a\u5206\u6790profile\u6587\u4ef6\"><\/a>\u7b2c\u4e8c\u9636\u6bb5\uff1a\u5206\u6790profile\u6587\u4ef6<\/h2>\n<h3><a name=\"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528-\u914d\u7f6eUI\u754c\u9762\"><\/a>\u914d\u7f6eUI\u754c\u9762<\/h3>\n<ul>\n<li>\u53ea\u8981\u8ba9\u901a\u8fc7web\u8bbf\u95eexhprof-0.9.2\/xhprof_html\/index.php\u5373\u53ef\u3002<\/li>\n<li>\u5b9e\u9645\u4e0axhprof\u4ea7\u51fa\u7684\u5c31\u662f\u4e2aphp\u6570\u7ec4\uff0c\u5e8f\u5217\u5316\u4e4b\u540e\u4fdd\u5b58\u5230\u78c1\u76d8<\/li>\n<li>xhprof UI\u5c31\u662f\u8bfb\u53d6\u8fd9\u4e2a\u5e8f\u5217\u5316\u540e\u7684\u6570\u7ec4\u5e76\u5206\u6790\u3002<\/li>\n<\/ul>\n<h3><a name=\"xhprof\u5b89\u88c5\uff0c\u914d\u7f6e\uff0c\u4f7f\u7528-\u4f7f\u7528UI\u5206\u6790profile\u6587\u4ef6\"><\/a>\u4f7f\u7528UI\u5206\u6790profile\u6587\u4ef6<\/h3>\n<ul>\n<li>\u6b63\u5728coding\u7684\u5217\u8868\u7a0b\u5e8f\uff1a<\/li>\n<li>\u9996\u5148\u8981\u83b7\u5f97profile\u5bf9\u5e94\u7684source\u548crun\u4e24\u4e2a\u53c2\u6570<\/li>\n<li>source\u662f\u5bf9\u5e94\u7a0b\u5e8f\u8c03\u7528<\/li>\n<li>run\u5bf9\u5e94\u8be5\u7a0b\u5e8f\u67d0\u4e00\u6b21\u8c03\u7528\uff0c\u76ee\u524d\u8be5\u6570\u503c\u4e3a\u7a0b\u5e8f\u6267\u884c\u7684\u79d2\u6570\u4e0e\u5360\u7528\u5185\u5b58\u7684\u7ed3\u5408\u3002\u6bd4\u5982\uff1a&#8221;0023_0015&#8243; \u4ee3\u8868\u6267\u884c23\u79d2\uff0c\u5360\u7528\u5185\u5b5815M<\/li>\n<\/ul>\n<div>\n<div>\n<div id=\"highlighter_190203\">\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0003.test_xlight_me___Goods06_BJBetIndex_php?GoodsType=Score_GoodsNo=<\/code><code>090822<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0003.test_xlight_me___Goods06_BJBetIndex_php?GoodsType=TotalGoals<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0003.test_xlight_me___Goods06_BJBetIndex_php?GoodsType=TotalGoals_GoodsNo=<\/code><code>090822<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0003.test_xlight_me___Goods06_BJBetIndex_php?GoodsType=WDL<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0015.___home_Html_Shell_Buy_AutoDispenseProject_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0015.___home_Html_Shell_Buy_DeductProjectMoney_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0015.liyq_xlight_me___Goods06_BJBetIndex_php?GoodsType=Score<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0002_0015.liyq_xlight_me___Goods06_BJBetIndex_php?GoodsType=WDL<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0003_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0003_0015.___home_Html_Shell_Buy_ComputeAssure_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0003_0015.liyq_xlight_me___Goods06_BJBetIndex_php?GoodsType=TotalGoals<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0004_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0004_0009.hejm_xlight_me___User_UserCenter_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0004_0015.___home_Html_Shell_Buy_ComputeAssure_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0005_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0005_0003.test_xlight_me___<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0005_0008.hejm_xlight_me___Goods06_P33D_P3New_php?GoodsType=P3<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0005_0015.___home_Html_Shell_Buy_ComputeAssure_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0005_0015.___home_Html_Shell_Buy_DeductProjectMoney_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0006_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0006_0010.hejm_xlight_me___<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0006_0015.___home_Html_Shell_Buy_ComputeAssure_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0006_0015.___home_Html_Shell_Buy_DeductProjectMoney_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0007_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0007_0010.hejm_xlight_me___<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0007_0015.___home_Html_Shell_Buy_ComputeAssure_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0008_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0009_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0009_0008.hejm_xlight_me___Goods06_SSQ7LC_<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0010_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0010_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0011_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0011_0004.liqh_xlight_me___<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0011_0015.___home_Html_Shell_Buy_DeductProjectMoney_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0013_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0014_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0016_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0016_0018.huxl_xlight_me___<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0017_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0019_0000.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0024_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0027_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>0029_0001.test_xlight_me___Remoting_gateway_php<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u9636\u6bb5\uff1a\u751f\u6210profile\u6587\u4ef6 \u5b89\u88c5 pecl install channel:\/\/pecl.php.net\/xhprof-0.9.2 \uff08\u76ee\u524d\u662fBeta\u7248\uff09\uff0c \u5982\u679c\u4e0d\u80fd\u76f4\u63a5install\uff0c\u5219\u53ef\u4ee5 pecl download\u4e0b\u6765\u540e\uff0cphpize &amp;&amp; .\/configure &amp;&amp; make &amp;&amp; make install \u7f16\u8f91php.ini \u6dfb\u52a0\u5982\u4e0b extension=xhprof.so ;Path to store xhprof file, ;\u9700\u8981\u5b9a\u671f\u6e05\u7406 ;\u6ce8\u610f\u521b\u5efa\u8def\u5f84\u548c\u6743\u9650 xhprof.output_dir=&#8221;\/logs\/xhprof&#8221; \u5728\u751f\u4ea7\u73af\u5883\u4e2d\u542f\u7528 \/home\/xLight\/php\/lib\/prepend.php: &lt;?php \/\/* \u542f\u52a8xhprof\uff0c\u4e07\u5206\u4e4b\u4e00\u6982\u7387 if(mt_rand(1,\u00a010000)==1\u00a0&amp;&amp; function_exists(&#8216;xhprof_enable&#8217;) ) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0xhprof_enable(XHPROF_FLAGS_MEMORY);\/\/XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY\u00a0 ,\u5b98\u65b9\u4e0d\u5efa\u8bae\u5728\u751f\u4ea7\u73af\u5883\u5f00\u542fXHPROF_FLAGS_CPU \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0define(&#8216;XHPROF_ON&#8217;,true);\/\/\u6807\u8bb0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u5b9a\u4e49\u8f93\u51faprofile\u6587\u4ef6\u7684\u89c4\u5219 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0define(&#8216;XHPROF_TIMELIMIT&#8217;,\u00a010);\/\/\u8bb0\u5f55\u6267\u884c\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u7684\u3002\u5355\u4f4d\uff1a\u79d2 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0define(&#8216;XHPROF_MEMLIMIT&#8217;,\u00a050);\/\/\u8bb0\u5f55\u5185\u5b58\u4f7f\u7528\u8d85\u8fc7\u8fd9\u4e2a\u91cf\u7684\u3002\u5355\u4f4d\uff1aM \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/define(&#8216;XHPROF_DIR&#8217;, &#8216;\/&#8217;.date(&#8216;Ymd_H&#8217;) );\u00a0 \/\/\u5f00\u542f\u672c\u884c\u5219\u542f\u7528\u81ea\u5df1\u7684\u6309\u65f6\u95f4\u62c6\u5206\u8def\u5f84\u903b\u8f91 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0register_shutdown_function(&#8216;xhprof_save&#8217;); \/\/die\u5f3a\u884c\u7ec8\u6b62\u7684\u7a0b\u5e8f\u4e5f\u4f1a\u6709\u8bb0\u5f55 } \/\/*\/ \/home\/xLight\/php\/lib\/append.php: function xhprof_save(){&#8230; <\/p>\n<div class=\"read-more\"><a href=\"https:\/\/xlight.me\/blog\/2016\/12\/xhprof%e5%ae%89%e8%a3%85%ef%bc%8c%e9%85%8d%e7%bd%ae%ef%bc%8c%e4%bd%bf%e7%94%a8\/\">Read More<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":3,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/posts\/92\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlight.me\/blog\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}