{"id":267,"date":"2015-01-30T14:49:55","date_gmt":"2015-01-30T07:49:55","guid":{"rendered":"http:\/\/ethaizone.com\/blog\/?p=267"},"modified":"2016-01-04T10:50:51","modified_gmt":"2016-01-04T03:50:51","slug":"%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xhprof","status":"publish","type":"post","link":"https:\/\/ethaizone.me\/blog\/2015\/01\/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xhprof\/","title":{"rendered":"\u0e27\u0e34\u0e18\u0e35\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 XHProf"},"content":{"rendered":"<h1><strong>XHProf \u0e04\u0e37\u0e2d\u0e2d\u0e30\u0e44\u0e23?<\/strong><\/h1>\n<p>\u0e2a\u0e31\u0e49\u0e19\u0e46 \u0e04\u0e37\u0e2d\u0e21\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e01\u0e25\u0e38\u0e48\u0e21 Profiler \u0e2b\u0e23\u0e37\u0e2d Performance analysis \u0e0b\u0e36\u0e48\u0e07\u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e27\u0e48\u0e32\u0e42\u0e04\u0e49\u0e14 PHP \u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32\u0e17\u0e33\u0e07\u0e32\u0e19\u0e0a\u0e49\u0e32\u0e15\u0e23\u0e07\u0e44\u0e2b\u0e19 \u0e21\u0e31\u0e19\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1a\u0e2d\u0e01\u0e44\u0e14\u0e49\u0e43\u0e19\u0e23\u0e30\u0e14\u0e31\u0e1a Function \u0e2b\u0e23\u0e37\u0e2d Method \u0e42\u0e14\u0e22\u0e1a\u0e2d\u0e01\u0e44\u0e14\u0e49\u0e27\u0e48\u0e32\u0e16\u0e39\u0e01\u0e40\u0e23\u0e35\u0e22\u0e01\u0e01\u0e35\u0e48\u0e04\u0e23\u0e31\u0e49\u0e07 \u0e43\u0e04\u0e23\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e19\u0e40\u0e23\u0e35\u0e22\u0e01 \u0e43\u0e0a\u0e49\u0e40\u0e27\u0e25\u0e32\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e31\u0e49\u0e19\u0e19\u0e32\u0e19\u0e40\u0e17\u0e48\u0e32\u0e44\u0e23 \u0e41\u0e25\u0e30\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e23\u0e32\u0e1f\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e39\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22\u0e02\u0e36\u0e49\u0e19 \u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22\u0e04\u0e37\u0e2d\u0e43\u0e0a\u0e49\u0e14\u0e39\u0e27\u0e48\u0e32\u0e42\u0e04\u0e49\u0e14\u0e2a\u0e48\u0e27\u0e19\u0e44\u0e2b\u0e19\u0e40\u0e02\u0e35\u0e22\u0e19\u0e14\u0e35\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48\u0e14\u0e35 \u0e22\u0e31\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1b\u0e23\u0e31\u0e1a pattern \u0e44\u0e14\u0e49\u0e44\u0e2b\u0e21 \u0e04\u0e38\u0e49\u0e21\u0e44\u0e2b\u0e21\u0e17\u0e35\u0e48\u0e08\u0e30\u0e17\u0e33 \u0e2d\u0e30\u0e44\u0e23\u0e17\u0e35\u0e48\u0e21\u0e31\u0e19\u0e0a\u0e49\u0e32 \u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e2a\u0e34\u0e48\u0e07\u0e19\u0e35\u0e49\u0e01\u0e31\u0e1a\u0e1e\u0e27\u0e01 Legacy code \u0e44\u0e14\u0e49 \u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e44\u0e1b\u0e07\u0e21\u0e42\u0e02\u0e48\u0e07\u0e27\u0e48\u0e32\u0e2d\u0e30\u0e44\u0e23\u0e17\u0e35\u0e48\u0e0a\u0e49\u0e32<\/p>\n<p><!--more--><\/p>\n<p>\u0e42\u0e14\u0e22\u0e2a\u0e48\u0e27\u0e19\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e02\u0e2d\u0e07 XHProf \u0e21\u0e35 2 \u0e2a\u0e48\u0e27\u0e19 \u0e04\u0e37\u0e2d \u0e2a\u0e48\u0e27\u0e19 PHP Extension \u0e01\u0e31\u0e1a\u0e2a\u0e48\u0e27\u0e19 Report \u0e0b\u0e36\u0e48\u0e07\u0e43\u0e19\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e08\u0e30\u0e1a\u0e2d\u0e01\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e08\u0e23\u0e34\u0e07\u0e41\u0e25\u0e30\u0e07\u0e48\u0e32\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14<\/p>\n<p>\u0e04\u0e33\u0e40\u0e15\u0e37\u0e2d\u0e19 \u0e40\u0e08\u0e49\u0e32\u0e02\u0e2d\u0e07\u0e1a\u0e25\u0e47\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e1e\u0e27\u0e01\u0e0a\u0e2d\u0e1a Ubuntu \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e43\u0e04\u0e23\u0e43\u0e0a\u0e49 OS \u0e2d\u0e37\u0e48\u0e19\u0e01\u0e47\u0e40\u0e2d\u0e32\u0e15\u0e31\u0e27\u0e23\u0e2d\u0e14\u0e01\u0e31\u0e19\u0e40\u0e2d\u0e07\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a \u0e41\u0e25\u0e30\u0e1c\u0e21\u0e21\u0e31\u0e01\u0e08\u0e30\u0e44\u0e21\u0e48 sudo su \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e16\u0e37\u0e2d\u0e27\u0e48\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e17\u0e35\u0e48\u0e2b\u0e25\u0e27\u0e21\u0e21\u0e32\u0e01\u0e46 \u0e04\u0e38\u0e13\u0e04\u0e27\u0e23\u0e43\u0e0a\u0e49\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c root \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19<\/p>\n<h1><strong>\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 XHProf \u0e2a\u0e48\u0e27\u0e19 PHP Extension<\/strong><\/h1>\n<p><strong>\u0e04\u0e33\u0e40\u0e15\u0e37\u0e2d\u0e19<\/strong> \u0e2b\u0e27\u0e31\u0e07\u0e27\u0e48\u0e32\u0e04\u0e19\u0e2d\u0e48\u0e32\u0e19\u0e08\u0e30\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e42\u0e2b\u0e25\u0e14 PHP Extension \u0e40\u0e1b\u0e47\u0e19\u0e19\u0e30<\/p>\n<p>\u0e01\u0e48\u0e2d\u0e19\u0e2d\u0e37\u0e48\u0e19 \u0e42\u0e1b\u0e23\u0e14\u0e21\u0e31\u0e48\u0e19\u0e43\u0e08\u0e01\u0e48\u0e2d\u0e19\u0e27\u0e48\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e23\u0e31\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 pecl \u0e44\u0e14\u0e49 \u0e0b\u0e36\u0e48\u0e07\u0e16\u0e49\u0e32\u0e23\u0e31\u0e19\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e43\u0e2b\u0e49\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n<pre class=\"brush:shell\">sudo apt-get install pear\r\nsudo apt-get install php5-dev<\/pre>\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e43\u0e2b\u0e49\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 XHProf \u0e1c\u0e48\u0e32\u0e19\u0e17\u0e32\u0e07 PECL \u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e35\u0e49<\/p>\n<pre class=\"brush:shell\">sudo pecl install -f xhprof<\/pre>\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e23\u0e32\u0e08\u0e30\u0e42\u0e2b\u0e25\u0e14 extension \u0e40\u0e02\u0e49\u0e32 PHP \u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e40\u0e01\u0e47\u0e1a log \u0e17\u0e35\u0e48\u0e15\u0e31\u0e27 XHProf \u0e21\u0e31\u0e19\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32 \u0e43\u0e19\u0e17\u0e35\u0e48\u0e19\u0e35\u0e49\u0e1c\u0e21\u0e08\u0e30\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e27\u0e49\u0e43\u0e19\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c home \u0e02\u0e2d\u0e07 account \u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32\u0e40\u0e2d\u0e07 \u0e41\u0e25\u0e30\u0e01\u0e33\u0e2b\u0e19\u0e14 permission \u0e43\u0e2b\u0e49\u0e21\u0e31\u0e19<\/p>\n<pre class=\"brush:shell\">mkdir ~\/xhprof<\/pre>\n<p>\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27 \u0e43\u0e2b\u0e49\u0e17\u0e33\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c mod \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a load \u0e40\u0e02\u0e49\u0e32 PHP \u0e0b\u0e36\u0e48\u0e07\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e1c\u0e21\u0e08\u0e30\u0e44\u0e21\u0e48\u0e1a\u0e2d\u0e01\u0e19\u0e30 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e1a\u0e32\u0e07\u0e04\u0e19\u0e43\u0e0a\u0e49 Apache \u0e42\u0e2b\u0e25\u0e14 PHP Module \u0e1a\u0e32\u0e07\u0e04\u0e19 PHP-FPM \u0e2b\u0e23\u0e37\u0e2d\u0e2d\u0e30\u0e44\u0e23\u0e01\u0e47\u0e15\u0e32\u0e21 \u0e2a\u0e23\u0e38\u0e1b\u0e02\u0e49\u0e32\u0e07\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c ini \u0e43\u0e2b\u0e49\u0e40\u0e02\u0e35\u0e22\u0e19\u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49<\/p>\n<pre class=\"brush:plain\">extension = xhprof.so\r\nxhprof.output_dir=\"\/home\/&lt;your_username&gt;\/xhprof\"<\/pre>\n<p>\u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e41\u0e17\u0e19\u0e04\u0e48\u0e32 &lt;your_username&gt; \u0e14\u0e49\u0e27\u0e22\u0e0a\u0e37\u0e48\u0e2d account \u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e43\u0e0a\u0e49\u0e25\u0e47\u0e2d\u0e01\u0e2d\u0e34\u0e19\u0e40\u0e02\u0e49\u0e32 Ubuntu \u0e04\u0e23\u0e31\u0e1a \u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e43\u0e2b\u0e49\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01<\/p>\n<p>\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e04\u0e37\u0e2d\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 Apache \u0e2b\u0e23\u0e37\u0e2d PHP \u0e04\u0e23\u0e31\u0e1a \u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e15\u0e32\u0e21\u0e2a\u0e30\u0e14\u0e27\u0e01\u0e40\u0e25\u0e22<\/p>\n<h1>\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 XHProf \u0e2a\u0e48\u0e27\u0e19\u0e2d\u0e2d\u0e01\u0e2b\u0e19\u0e49\u0e32\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19<\/h1>\n<p>\u0e01\u0e48\u0e2d\u0e19\u0e2d\u0e37\u0e48\u0e19\u0e19\u0e35\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2a\u0e33\u0e04\u0e31\u0e0d\u0e21\u0e32\u0e01 \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e19\u0e17\u0e35\u0e48\u0e21\u0e35\u0e2b\u0e25\u0e32\u0e22\u0e40\u0e27\u0e47\u0e1a\u0e2d\u0e22\u0e39\u0e48\u0e20\u0e32\u0e22\u0e43\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e14\u0e2a\u0e2d\u0e1a \u0e04\u0e38\u0e13\u0e04\u0e27\u0e23\u0e21\u0e35\u0e42\u0e14\u0e40\u0e21\u0e19\u0e01\u0e25\u0e32\u0e07\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c <code>\/var\/www<\/code> \u0e14\u0e49\u0e27\u0e22 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e35\u0e48 XHProf \u0e2a\u0e48\u0e27\u0e19\u0e17\u0e35\u0e48\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e08\u0e30\u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e27\u0e32\u0e07\u0e44\u0e27\u0e49\u0e15\u0e23\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22\u0e46 \u0e08\u0e32\u0e01\u0e17\u0e38\u0e01\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e47\u0e04<\/p>\n<p>\u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e43\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e35\u0e49\u0e1c\u0e21\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e14\u0e22\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07\u0e27\u0e48\u0e32\u0e1c\u0e21\u0e08\u0e30\u0e27\u0e32\u0e07\u0e15\u0e31\u0e27\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e44\u0e27\u0e49\u0e17\u0e35\u0e48 <code>\/var\/www\/xhprof<\/code> \u0e41\u0e25\u0e30\u0e08\u0e30\u0e16\u0e39\u0e01\u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e49\u0e27\u0e22 <code>http:\/\/localhost\/xhprof<\/code> \u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e2d\u0e31\u0e19\u0e40\u0e02\u0e49\u0e32\u0e43\u0e08\u0e15\u0e23\u0e07\u0e01\u0e31\u0e19\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a\u0e27\u0e48\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e0b\u0e47\u0e15\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e44\u0e14\u0e49\u0e41\u0e25\u0e49\u0e27\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a \u0e2a\u0e48\u0e27\u0e19\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e47\u0e04\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e02\u0e2d\u0e07\u0e1c\u0e21\u0e08\u0e30\u0e2d\u0e22\u0e39\u0e48\u0e20\u0e32\u0e22\u0e43\u0e15\u0e49 <code>\/var\/www<\/code> \u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e40\u0e0a\u0e48\u0e19 <code>\/var\/www\/ethaizone.com<\/code> \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19\u0e04\u0e23\u0e31\u0e1a<\/p>\n<p>\u0e01\u0e48\u0e2d\u0e19\u0e2d\u0e37\u0e48\u0e19\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c xhprof \u0e41\u0e15\u0e48\u0e40\u0e23\u0e32\u0e08\u0e30\u0e19\u0e33\u0e42\u0e04\u0e49\u0e14\u0e25\u0e07\u0e21\u0e32\u0e14\u0e49\u0e27\u0e22\u0e01\u0e32\u0e23 git clone \u0e41\u0e17\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e07\u0e48\u0e32\u0e22<\/p>\n<pre class=\"brush:shell\">cd \/var\/www\r\ngit clone https:\/\/github.com\/facebook\/xhprof xhprof<\/pre>\n<p>\u0e40\u0e23\u0e32\u0e08\u0e30\u0e44\u0e14\u0e49\u0e42\u0e04\u0e49\u0e14\u0e2a\u0e48\u0e27\u0e19\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e21\u0e32\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 <code>\/var\/www\/xhprof<\/code> \u0e41\u0e25\u0e49\u0e27<\/p>\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e2a\u0e34\u0e48\u0e07\u0e17\u0e35\u0e48\u0e08\u0e30\u0e02\u0e32\u0e14\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49 \u0e43\u0e2b\u0e49\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 graphviz \u0e14\u0e49\u0e27\u0e22 \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 Callgraph \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19<\/p>\n<pre class=\"brush:shell\">sudo apt-get install graphviz<\/pre>\n<p>\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e43\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e35\u0e49\u0e04\u0e23\u0e31\u0e1a<\/p>\n<h1>\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e15\u0e31\u0e27\u0e40\u0e23\u0e34\u0e48\u0e21\u0e08\u0e31\u0e1a Profiler \u0e02\u0e2d\u0e07 XHProf<\/h1>\n<p>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e44\u0e14\u0e49\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e21\u0e32\u0e19\u0e35\u0e49 XHProf \u0e08\u0e30\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e40\u0e23\u0e34\u0e48\u0e21\u0e08\u0e31\u0e1a Profiler \u0e40\u0e25\u0e22 \u0e40\u0e23\u0e32\u0e08\u0e36\u0e07\u0e15\u0e49\u0e2d\u0e07\u0e21\u0e35\u0e42\u0e04\u0e49\u0e14 PHP \u0e2a\u0e48\u0e27\u0e19\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e17\u0e35\u0e48\u0e40\u0e2d\u0e32\u0e21\u0e32\u0e04\u0e25\u0e38\u0e21\u0e2b\u0e31\u0e27\u0e17\u0e49\u0e32\u0e22 \u0e0b\u0e36\u0e48\u0e07\u0e2b\u0e25\u0e32\u0e22\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e17\u0e35\u0e48\u0e1c\u0e21\u0e2d\u0e48\u0e32\u0e19\u0e40\u0e08\u0e2d\u0e21\u0e32 \u0e21\u0e31\u0e01\u0e08\u0e30\u0e1a\u0e2d\u0e01\u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e40\u0e2d\u0e32\u0e42\u0e04\u0e49\u0e14\u0e41\u0e1b\u0e30\u0e2b\u0e31\u0e27\u0e17\u0e49\u0e32\u0e22 index.php \u0e02\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e47\u0e04\u0e40\u0e2d\u0e07 \u0e41\u0e15\u0e48\u0e1c\u0e21\u0e27\u0e48\u0e32\u0e21\u0e31\u0e19 &#8220;\u0e22\u0e38\u0e48\u0e07\u0e22\u0e32\u0e01&#8221; \u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e23\u0e32\u0e21\u0e32\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e21\u0e31\u0e19\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22\u0e02\u0e36\u0e49\u0e19\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32<\/p>\n<p>\u0e42\u0e14\u0e22\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e17\u0e35\u0e48\u0e1c\u0e21\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e17\u0e33 php auto prepend \u0e41\u0e25\u0e30 append \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e08\u0e30\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e44\u0e1b\u0e41\u0e17\u0e23\u0e01\u0e42\u0e04\u0e49\u0e14\u0e40\u0e2d\u0e07\u0e43\u0e19\u0e17\u0e38\u0e01\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e47\u0e04 \u0e41\u0e25\u0e49\u0e27\u0e08\u0e36\u0e07\u0e04\u0e38\u0e21\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e14\u0e49\u0e27\u0e22\u0e01\u0e32\u0e23\u0e40\u0e0a\u0e47\u0e04 cookie \u0e27\u0e48\u0e32\u0e21\u0e35\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48\u0e21\u0e35<\/p>\n<p>\u0e40\u0e23\u0e34\u0e48\u0e21\u0e01\u0e31\u0e19\u0e40\u0e25\u0e22<\/p>\n<pre class=\"brush:shell\">nano \/var\/www\/xhprof\/header.php<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e27\u0e32\u0e07\u0e42\u0e04\u0e49\u0e14\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49<\/p>\n<pre class=\"brush:php\">&lt;?php\r\n    if (extension_loaded('xhprof') &amp;&amp; isset($_COOKIE['xhprof']) &amp;&amp; $_COOKIE['xhprof'] == 'omg'\u00a0&amp;&amp; stripos($_SERVER['REQUEST_URI'], 'xhprof') === false) {\r\n    include_once '\/var\/www\/xhprof\/xhprof_lib\/utils\/xhprof_lib.php';\r\n    include_once '\/var\/www\/xhprof\/xhprof_lib\/utils\/xhprof_runs.php';\r\n    xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);\r\n}<\/pre>\n<p>\u0e41\u0e01\u0e49\u0e0a\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e4a\u0e01\u0e01\u0e35\u0e49\u0e01\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e02\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07 (\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22) \u0e41\u0e25\u0e49\u0e27\u0e17\u0e33\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01 \u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2d\u0e35\u0e01\u0e44\u0e1f\u0e25\u0e4c<\/p>\n<pre class=\"brush:shell\">nano \/var\/www\/xhprof\/footer.php<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e27\u0e32\u0e07\u0e42\u0e04\u0e49\u0e14\u0e19\u0e35\u0e49\u0e04\u0e23\u0e31\u0e1a<\/p>\n<pre class=\"brush:php\">&lt;?php\r\nif (extension_loaded('xhprof') &amp;&amp; isset($_COOKIE['xhprof']) &amp;&amp; $_COOKIE['xhprof'] == 'omg'\u00a0&amp;&amp; stripos($_SERVER['REQUEST_URI'], 'xhprof') === false) {\r\n    $profiler_namespace = 'myapp'; \/\/ namespace for your application\r\n    $xhprof_data = xhprof_disable();\r\n    $xhprof_runs = new XHProfRuns_Default();\r\n    $run_id = $xhprof_runs-&gt;save_run($xhprof_data, $profiler_namespace);\r\n    \/\/ url to the XHProf UI libraries (change the host name and path)\r\n    $profiler_url = sprintf('http:\/\/localhost\/xhprof\/xhprof_html\/?run=%s&amp;source=%s', $run_id, $profiler_namespace);\r\n    echo '&lt;a href=\"'. $profiler_url .'\" target=\"_blank\"&gt;Profiler output&lt;\/a&gt;';\r\n}<\/pre>\n<p>\u0e41\u0e01\u0e49\u0e0a\u0e37\u0e48\u0e2d\u0e04\u0e38\u0e4a\u0e01\u0e01\u0e35\u0e49\u0e01\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e02\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07 (\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22) \u0e41\u0e25\u0e30\u0e04\u0e48\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e43\u0e19 header.php \u0e02\u0e49\u0e32\u0e07\u0e1a\u0e19\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a \u0e41\u0e25\u0e49\u0e27\u0e17\u0e33\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01<\/p>\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e1c\u0e21\u0e08\u0e30\u0e40\u0e1e\u0e34\u0e48\u0e21 auto prepend \u0e25\u0e07 .htaccess<\/p>\n<pre class=\"brush:shell\">nano \/var\/www\/.htaccess<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e42\u0e04\u0e49\u0e14\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e35\u0e49<\/p>\n<pre class=\"brush:plain\">php_value auto_prepend_file \"\/var\/www\/xhprof\/header.php\"\r\nphp_value auto_append_file \"\/var\/www\/xhprof\/footer.php\"<\/pre>\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e43\u0e2b\u0e49\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01 \u0e40\u0e17\u0e48\u0e32\u0e17\u0e35\u0e48\u0e01\u0e47\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27\u0e04\u0e23\u0e31\u0e1a<\/p>\n<h1>\u0e17\u0e14\u0e25\u0e2d\u0e07\u0e43\u0e0a\u0e49 XHProf \u0e04\u0e23\u0e31\u0e49\u0e07\u0e41\u0e23\u0e01<\/h1>\n<p>\u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e07\u0e48\u0e32\u0e22\u0e46 \u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a \u0e2b\u0e32 browser \u0e2a\u0e31\u0e01\u0e15\u0e31\u0e27 \u0e40\u0e1b\u0e34\u0e14\u0e40\u0e27\u0e47\u0e1a\u0e43\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2a\u0e31\u0e01\u0e40\u0e27\u0e47\u0e1a \u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27\u0e41\u0e01\u0e49 cookie \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2d\u0e31\u0e19\u0e43\u0e2b\u0e21\u0e48\u0e0a\u0e37\u0e48\u0e2d xhprof \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e27\u0e49\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c header.php \u0e41\u0e25\u0e49\u0e27\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e34\u0e14\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a\u0e43\u0e2b\u0e21\u0e48\u0e2d\u0e35\u0e01\u0e17\u0e35 \u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19\u0e25\u0e07\u0e21\u0e32\u0e25\u0e48\u0e32\u0e07\u0e2a\u0e38\u0e14 \u0e04\u0e38\u0e13\u0e2a\u0e48\u0e27\u0e19\u0e40\u0e08\u0e2d\u0e25\u0e34\u0e07\u0e01\u0e4c\u0e04\u0e33\u0e27\u0e48\u0e32 Profiler output \u0e43\u0e2b\u0e49\u0e01\u0e14\u0e25\u0e34\u0e07\u0e01\u0e4c\u0e40\u0e25\u0e22 \u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e17\u0e33\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07 \u0e21\u0e31\u0e19\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e43\u0e2b\u0e49\u0e04\u0e38\u0e13\u0e14\u0e39\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22<\/p>\n<p>\u0e2a\u0e48\u0e27\u0e19\u0e43\u0e19\u0e01\u0e23\u0e13\u0e35\u0e04\u0e38\u0e13\u0e40\u0e08\u0e2d error \u0e17\u0e35\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e02\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e1a permission \u0e02\u0e2d\u0e07 XHProf \u0e43\u0e2b\u0e49\u0e17\u0e33\u0e01\u0e32\u0e23\u0e23\u0e31\u0e19\u0e2a\u0e2d\u0e07\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e35\u0e49\u0e04\u0e23\u0e31\u0e1a<\/p>\n<pre class=\"brush:shell\">sudo chown www-data ~\/xhprof\/ -R\r\nsudo chown www-data \/var\/www\/xhprof\/ -R<\/pre>\n<p>\u0e2b\u0e27\u0e31\u0e07\u0e27\u0e48\u0e32\u0e08\u0e30\u0e0a\u0e48\u0e27\u0e22\u0e44\u0e14\u0e49\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>XHProf \u0e04\u0e37\u0e2d\u0e2d\u0e30\u0e44\u0e23? \u0e2a\u0e31\u0e49\u0e19\u0e46 \u0e04\u0e37\u0e2d\u0e21\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21 &hellip; <a href=\"https:\/\/ethaizone.me\/blog\/2015\/01\/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-xhprof\/\">\u0e2d\u0e48\u0e32\u0e19\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3,15,7,14],"tags":[],"class_list":["post-267","post","type-post","status-publish","format-standard","hentry","category-coding","category-php","category-ubuntu","category-web"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Iqnv-4j","_links":{"self":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/267"}],"collection":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":8,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/267\/revisions\/303"}],"wp:attachment":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}