<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[facebook分析php执行性能工具xhprof的安装与使用]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[技术文章]]></category>
<pubDate>Thu, 08 Oct 2015 07:48:20 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	一、安装xhprof<br/>1.1、下载xhprof<br/>下载地址：http://pecl.php.net/package/xhprof<br/><br/>我们选择最新的版本下载：<br/>wget http://pecl.php.net/get/xhprof-0.9.4.tgz<br/><br/>1.2、解压<br/>tar xzvf xhprof-0.9.4.tgz<br/><br/>1.3、编译安装<br/>cd xhprof-0.9.4/extension/<br/>/usr/local/webserver/php/bin/phpize<br/>./configure --with-php-config=/usr/local/webserver/php/bin/php-config<br/>make<br/>make install<br/><br/>1.4、配置<br/>vi /usr/local/webserver/php/etc/php.ini<br/>添加：<br/>[xhprof]<br/>extension = "xhprof.so"<br/>xhprof.output_dir=/tmp/xhprof<br/><br/>1.5、查看xhprof是否正常加载<br/>/usr/local/webserver/php/bin/php -m&#124;grep xhprof<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=176" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=176" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>重启php-fpm<br/>/usr/local/webserver/php/sbin/php5 restart<br/>你也可以访问phpinfo页面查看是否已经加载xhprof<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=177" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=177" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>二、安装graphviz工具<br/>2.1、使用yum安装<br/>yum install graphviz libpng libpng-devel -y<br/><br/>2.2、编译安装<br/>下载地址：http://www.graphviz.org/Download_source.php<br/>下载当前最新版本<br/>wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz<br/>2.3、解压<br/>tar xzvf graphviz-2.38.0.tar.gz<br/><br/>2.4、编译<br/>cd graphviz-2.38.0/<br/>./configure --with-png=yes<br/>make<br/>make install<br/><br/>三、配置实例及xhprof图形化web工具<br/>3.1、到xhprof文件目录复制相关文件到站点目录<br/>cp -r examples xhprof_html xhprof_lib /home/www/<br/><br/>3.2、运行实例查看效果<br/>打开浏览器输入你的站点访问地址：http://url/examples/sample.php<br/>你会得到例似http:///index.php?run=561600a67ba32&source=xhprof_foo的URL,如下图：<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=178" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=178" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>把http://后面输入你的站点访问地址，再次使用浏览器打开就可以看见运行的结果了。<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=179" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=179" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>如果你点击：[View Full Callgraph]出现failed to execute cmd " dot -Tpng"的错误，可能是你的php.ini配置中disable_functions那里禁用了proc_open函数，修改php.ini配置文件去掉这个限制就可以图形展示了，感兴趣的朋友可以自己配置一个玩玩。<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=180" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=180" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>Tags - <a href="http://www.zhanghaijun.com/tags/graphviz/" rel="tag">graphviz</a> , <a href="http://www.zhanghaijun.com/tags/xhprof/" rel="tag">xhprof</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] facebook分析php执行性能工具xhprof的安装与使用]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>