<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>安装 &#8211; LPC影子技术分享</title>
	<atom:link href="https://www.mudbest.com/tag/%E5%AE%89%E8%A3%85/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.mudbest.com</link>
	<description>行影不离,忘之却步.</description>
	<lastBuildDate>Wed, 21 Nov 2012 02:16:32 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.1</generator>
	<item>
		<title>windows下手动搭建Apache+PHP+MySQL</title>
		<link>https://www.mudbest.com/windows%e4%b8%8b%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%baapachephpmysql/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Tue, 30 Oct 2012 06:09:37 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[下载]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[配置]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1642</guid>

					<description><![CDATA[一、下载 http://pan.baidu.com/share/link?shareid=95859&#038 ... <a title="windows下手动搭建Apache+PHP+MySQL" class="read-more" href="https://www.mudbest.com/windows%e4%b8%8b%e6%89%8b%e5%8a%a8%e6%90%ad%e5%bb%baapachephpmysql/" aria-label="阅读 windows下手动搭建Apache+PHP+MySQL">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p><strong>一、下载</strong><br />
http://pan.baidu.com/share/link?shareid=95859&#038;uk=2349308099</p>
<p><strong>二、安装、解压</strong><br />
 1. Apache</p>
<p>　　主要配置Network Domain、Server Name、Email地址（我依次填的是localhost、localhost、邮箱随意）以及Apache服务的占用端口，默认为80端口，你可以根据需要配置在其他端口，Apache的安装目录你可以使用默认目录或根据需要自行选择安装目录（我安装到 D:\Apache）。<span id="more-1642"></span></p>
<p>　　在完成apache服务的安装后，在游览器中输入http://localhost/，出现It’s work!字样，说明Apache服务安装成功了。</p>
<p>2. PHP</p>
<p>　　只要解压php-5.3.4-Win32-VC6-x86.zip并重名为文件夹为php到某个盘即可完成PHP安装（我是将其解压复制到D盘目录下 D:\web_server\php5.3）</p>
<p> 3. MySQL</p>
<p>　　点击Mysql安装程序自动安装，在此期间你可以根据需要选择Mysql数据库的安装目录（我安装到 D:\web_server\MySQL），MySQL 安装完后会启动向导，你可以先取消，下一部的配置里有说。 </p>
<p><strong>三、配置 </strong><br />
<em><br />
 1. Apache（Apache配置文件httpd.conf在Apache安装目录下的conf文件夹里面）</em></p>
<p>(1)默认Apache服务器执行WEB主程序的目录为Apache2.2/htdocs，所以当你的WEB主程序目录变更时，我们需要修改相应的Apache配置（我改到D:\web_server\apache2.2\htdocs），即用文本编辑软件打开 httpd.conf 将 </p>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
&lt;Directory /&gt;
	Options FollowSymLinks
	AllowOverride None
	Order deny,allow
	Deny from all
&lt;/Directory&gt;
</pre>
<p>将其注释掉</p>
<pre class="brush: plain; title: ; notranslate">
#&lt;Directory /&gt;
#	Options FollowSymLinks
#	AllowOverride None
#	Order deny,allow
#	Deny from all
#&lt;/Directory&gt;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
&lt;Directory &quot;D:/web_server/apache2.2/htdocs&quot;&gt;
	#
	# Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs/2.2/mod/core.html#options
	# for more information.
	#
	Options Indexes FollowSymLinks

	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
	AllowOverride None

	#
	# Controls who can get stuff from this server.
	#
	Order allow,deny
	Allow from all

&lt;/Directory&gt;
</pre>
<p>将其注释</p>
<pre class="brush: plain; title: ; notranslate">
#&lt;Directory &quot;D:/web_server/apache2.2/htdocs&quot;&gt;
	#
	# Possible values for the Options directive are &quot;None&quot;, &quot;All&quot;,
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that &quot;MultiViews&quot; must be named *explicitly* --- &quot;Options All&quot;
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs/2.2/mod/core.html#options
	# for more information.
	#
#	Options Indexes FollowSymLinks

	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
#	AllowOverride None

	#
	# Controls who can get stuff from this server.
	#
#	Order allow,deny
#	Allow from all

#&lt;/Directory&gt;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#Include conf/extra/httpd-vhosts.conf
</pre>
<p>将注释去掉</p>
<pre class="brush: plain; title: ; notranslate">
Include conf/extra/httpd-vhosts.conf
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule rewrite_module modules/mod_rewrite.so
</pre>
<p>将注释去掉</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule rewrite_module modules/mod_rewrite.so
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
</pre>
<p>回车下一行增加以下内容</p>
<pre class="brush: plain; title: ; notranslate">
LoadModule php5_module &quot;D:/web_server/php5.3/php5apache2_2.dll&quot;
PHPIniDir &quot;D:/web_server/php5.3/&quot;
</pre>
<p>说明：在PHP目录下可以看到多个php5apache的DLL文件，由于我使用的是Apache2.2.17，所以我们当然需要使用php5apache2_2.dll，接着指定PHP的安装目录以及执行的程序扩展名。 </p>
<p><em> 2. PHP（配置文件php.ini在PHP安装目录下）</em></p>
<p>(1)把php.ini-development改名为php.ini，然后用文本编辑器修改php.ini，接下来的步骤都是在php.ini进行的。</p>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
; On windows:

; extension_dir = &quot;ext&quot;
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
; On windows:

extension_dir = &quot;D:/php/ext&quot;
</pre>
<p>表示指定PHP扩展包的具体目录，以便调用相应的DLL文件，这样就不用讲PHP的一些dll和php.ini复制到windows下了。</p>
<p>由于默认PHP并不支持自动连接Mysql，需开启相应的扩展库功能，比如php_mysql.dll等，即将 </p>
<pre class="brush: plain; title: ; notranslate">
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll 
; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed. 
; See http://www.php.net/manual/en/snmp.installation.php 
;extension=php_snmp.dll

;extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_zip.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;session.save_path = &quot;/tmp&quot;
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
session.save_path = &quot;D:/web_server/php5.3/session&quot;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;upload_tmp_dir =
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
upload_tmp_dir = &quot;D:/web_server/php5.3/temp&quot;
</pre>
<p>找到</p>
<pre class="brush: plain; title: ; notranslate">
;date.timezone =
</pre>
<p>修改为</p>
<pre class="brush: plain; title: ; notranslate">
date.timezone = &quot;Asia/Shanghai&quot;
</pre>
<p><em>3. MySQL</em><br />
点击开始菜单下Mysql Server5.5菜单中的Mysql Server Instance Config Wizard，完成Mysql的配置向导。</p>
<p>点击 Next》 后出现3个选项：选择Mysql服务器的类型</p>
<p>Developer Machine</p>
<p>Server Machine</p>
<p>Dedicated MySQL Machine</p>
<p>我选第2个“Server Machine”</p>
<p>然后又是3个选项：Mysql数据库用途</p>
<p>Multifunctional Database</p>
<p>Transactional Database Only</p>
<p>Non-Transactional Database Only</p>
<p>我选第1个“Multifunctional Database”</p>
<p>选择Mysql数据库的并发连接数</p>
<p>Decision Support （DSS）/OLAP：最大20个连接并发数</p>
<p>Online Transaction Processing（OLTP）：最大500个并发连接数</p>
<p>Manual Setting：自定义</p>
<p>我选自定义，设置为50</p>
<p>选择Mysql服务的端口号，一般默认即可</p>
<p>选择Mysql数据库的字符集（推荐使用UTF8，比较通用，否则容易造成乱码。）</p>
<p>Standard Character Set</p>
<p>Best Support For Multilingualism</p>
<p>Manual Selected Default Character Set / Collation</p>
<p>我选“Manual Selected Default Character Set / Collation”，然后在 Character Set 选择 utf8</p>
<p>设置Mysql为Windows服务</p>
<p>在这里考虑开机速度的问题，我将自动登录Mysql服务取消了，一般你可以选择此选项，如果没有选，你可以使用net start mysql启动Mysql服务（停止就是net stop mysql）。</p>
<p>我的选择是“Install AS Windows Service”和“Include Bin Directory in Windows PATH”勾选，“Launch the MySQL Server automatically”去掉勾选</p>
<p>设置Mysql数据库root用户的密码</p>
<p>执行Mysql服务配置选项</p>
<p>Mysql数据库的配置文件保存在D:\MySQL\my.ini，如果今后有什么变动，你可以修改此文件。 </p>
<p>到此，所有配置完成。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ubuntu12.04下memcached安装与配置</title>
		<link>https://www.mudbest.com/ubuntu12-04%e4%b8%8bmemcached%e5%ae%89%e8%a3%85%e4%b8%8e%e9%85%8d%e7%bd%ae/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Mon, 29 Oct 2012 05:11:37 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[服务]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1625</guid>

					<description><![CDATA[其中包括memcache服务器端的安装和memcached客户端的安装。 所谓服务器端的安装就是在服务器（一般 ... <a title="ubuntu12.04下memcached安装与配置" class="read-more" href="https://www.mudbest.com/ubuntu12-04%e4%b8%8bmemcached%e5%ae%89%e8%a3%85%e4%b8%8e%e9%85%8d%e7%bd%ae/" aria-label="阅读 ubuntu12.04下memcached安装与配置">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p>其中包括memcache服务器端的安装和memcached客户端的安装。<br />
所谓服务器端的安装就是在服务器（一般都是linux系统）上安装Memcache实现数据的存储</p>
<p>所谓客户端的安装就是指php（或者其他程序，memcache还有其他不错的api接口提供）去使用服务器端的memcache提供的函数，客户端需要php添加扩展。</p>
<p><strong>安装Memcache服务端</strong></p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install memcached
</pre>
<p><span id="more-1625"></span><br />
安装完Memcache服务端以后，我们需要启动该服务：</p>
<pre class="brush: plain; title: ; notranslate">
memcached -d -m 128 -p 11111 -u root
</pre>
<p>这里需要说明一下memcached服务的启动参数：</p>
<pre class="brush: plain; title: ; notranslate">
-p 监听的端口
-l 连接的IP地址, 默认是本机
-d start 启动memcached服务
-d restart 重起memcached服务
-d stop|shutdown 关闭正在运行的memcached服务
-d install 安装memcached服务
-d uninstall 卸载memcached服务
-u 以的身份运行 (仅在以root运行的时候有效)
-m 最大内存使用，单位MB。默认64MB
-M 内存耗尽时返回错误，而不是删除项
-c 最大同时连接数，默认是1024
-f 块大小增长因子，默认是1.25-n 最小分配空间，key+value+flags默认是48
-h 显示帮助
-P 是设置保存Memcache的pid文件
</pre>
<p>如果要杀掉memcached进程</p>
<pre class="brush: plain; title: ; notranslate">
kill 'cat /tmp/memcached.pid'
</pre>
<p>也可以启动多个守护进程，不过端口不能重复。<br />
重启web服务<br />
[/code lang=&#8221;text&#8221;]<br />
/etc/init.d/lighttpd -flighttpd.conf restart<br />
[/code]</p>
<p>Memcache环境测试：</p>
<pre class="brush: plain; title: ; notranslate">
telnet localhost 11211
//保存
set
good 32 0 10
helloworld
STORED
//取回
gets good
VALUE good 32 10 10
helloworld
END
//替换
replace good 32 0 10
worldhello
STORED
get good
VALUE good 32 10
worldhello
END
//尾部添加
append good 32 0 5
after
STORED
get good
VALUE good 32 15
worldhelloafter
END
//头部添加
prepend good 32 0 6
before
STORED
get good
VALUE good 32 21
beforeworldhelloafter
END
//删除
delete good
DELETED
get good
END
</pre>
<p><strong>安装memcache客户端（php5.3为示例）</strong></p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install php5-memcache
</pre>
<p>安装完以后我们需要在php.ini里进行简单的配置,打开/etc/php5/apache2/php.ini文件在末尾添加如下内容：</p>
<pre class="brush: plain; title: ; notranslate">
cp /etc/php5/apache2/php.ini /etc/php5/apache2.php.ini.bak
vi /etc/php5/apache2/php.ini
</pre>
<p>在文件内容最下面增加以下配置信息</p>
<pre class="brush: plain; title: ; notranslate">
&#x5B;Memcache]
;是否在遇到错误时透明的向其他服务器进行故障转移
memcache.allow_failover = On
;接受和发送数据时最多尝试多少个服务器，只在打开memcache.allow_failover时生效。
memcache.max_failover_attempts = 20
;数据将俺按照此值设定的块大小进行转移。此值越小所需的额外网络传输越多。
;如果发现无法解释的速度降低，可以尝试将此值增加到32768。
memcache.chunk_size = 8192
;链接到memcached服务器时使用的默认TCP端口。
memcache.default.port = 11111
;控制将key映射到server的策略。默认值“standard”表示使用先前版本的老hash策略
;设为“consistent”可以允许在链接池中添加/删除服务器时不必重新计算key与server之间&gt;的映射关系。
;memcache.hash_strategy = &quot;standard&quot;
;控制将key映射到server的散列函数。默认值“crc32”使用CRC32算法，而“fnv”则表示使用FNV-1a算法。
;FNV-1a比CRC32速度稍低，但是散列效果更好。
;memcache.hash_function = &quot;crc32&quot;
</pre>
<p><a href="http://www.mudbest.com/ubuntu12-04%e4%b8%8bmemcached%e5%ae%89%e8%a3%85%e4%b8%8e%e9%85%8d%e7%bd%ae/2012-10-26memcached/" rel="attachment wp-att-1627" target="_blank"><img fetchpriority="high" decoding="async" src="http://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26memcached.png" alt="" title="2012-10-26memcached" width="1280" height="1024" class="alignnone size-full wp-image-1627" srcset="https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26memcached.png 1280w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26memcached-537x430.png 537w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26memcached-1024x819.png 1024w" sizes="(max-width: 1280px) 100vw, 1280px" /></a></p>
<p>最后，保存php.ini,执行sudo /etc/init.d/apache2 restart重启Apache。</p>
<p><strong>在PHP中使用memcache</strong></p>
<pre class="brush: sql; title: ; notranslate">
#mysql数据库部分：
CREATE TABLE `conn` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=gb2312 AUTO_INCREMENT=7 ;
</pre>
<pre class="brush: php; title: ; notranslate">
//PHP代码部分
&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
	&lt;input type=&quot;text&quot; name=&quot;keys&quot;&gt; 
	&lt;input type=&quot;submit&quot; value=&quot;提交&quot;&gt;
&lt;/form&gt;
&lt;?php
if (! empty ( $_GET &#x5B;'keys'] )) {
	$arr = mem_db ( $_GET &#x5B;'keys'] );
	print_r ( $arr );
}
function mem_db($str) {
	$m = new memcache ();
	$m-&gt;connect ( &quot;127.0.0.1&quot;, 11211 ) or die ( &quot;连接错误&quot; );
	$mi = base64_encode ( $str ); // 加密进来的数据
	$exp = $m-&gt;get ( $mi );
	if (empty ( $exp )) {
		$row = sql_db ( $str ); // 数据库php100
		$m-&gt;set ( $mi, $row, 0, 3600 );
	}
	
	return $m-&gt;get ( $mi );
}
function sql_db($str) {
	mysql_connect ( &quot;localhost&quot;, &quot;root&quot;, &quot;2222&quot; );
	mysql_select_db ( &quot;news&quot; );
	mysql_query ( &quot;set names 'GBK'&quot; );
	$sql = &quot;select * from conn where title like '%&quot; . $str . &quot;%'&quot;;
	$query = mysql_query ( $sql );
	while ( $rs = mysql_fetch_array ( $query ) ) {
		$ru &#x5B;] = $rs;
	}
	return $ru;
}
?&gt;
</pre>
<p>到此为止，通过上面的步骤，我们就完成了memcache的配置和基本使用…</p>
<p><strong>php5-memcache扩展提供的方法</strong></p>
<pre class="brush: plain; title: ; notranslate">
Memcache::add — 添加一个值，如果已经存在，则返回false
Memcache::addServer — 添加一个可供使用的服务器地址
Memcache::close — 关闭一个Memcache对象
Memcache::connect — 创建一个Memcache对象
memcache_debug — 控制调试功能
Memcache::decrement — 对保存的某个key中的值进行减法操作
Memcache::delete — 删除一个key值
Memcache::flush — 清除所有缓存的数据
Memcache::get — 获取一个key值
Memcache::getExtendedStats — 获取进程池中所有进程的运行系统统计
Memcache::getServerStatus — 获取运行服务器的参数
Memcache::getStats — 返回服务器的一些运行统计信息
Memcache::getVersion — 返回运行的Memcache的版本信息
Memcache::increment — 对保存的某个key中的值进行加法操作
Memcache::pconnect — 创建一个Memcache的持久连接对象
Memcache::replace — R对一个已有的key进行覆写操作
Memcache::set — 添加一个值，如果已经存在，则覆写
Memcache::setCompressThreshold — 对大于某一大小的数据进行压缩
Memcache::setServerParams — 在运行时修改服务器的参数
</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Ubuntu12.04下安装Xdebug及配置</title>
		<link>https://www.mudbest.com/ubuntu12-04%e4%b8%8b%e5%ae%89%e8%a3%85xdebug%e5%8f%8a%e9%85%8d%e7%bd%ae/</link>
		
		<dc:creator><![CDATA[hkshadow]]></dc:creator>
		<pubDate>Fri, 26 Oct 2012 09:45:12 +0000</pubDate>
				<category><![CDATA[分享]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu12.04]]></category>
		<category><![CDATA[安装]]></category>
		<guid isPermaLink="false">http://www.mudbest.com/?p=1614</guid>

					<description><![CDATA[一: 安装xdebug，这里用pecl sudo apt-get install php-pear sudo  ... <a title="Ubuntu12.04下安装Xdebug及配置" class="read-more" href="https://www.mudbest.com/ubuntu12-04%e4%b8%8b%e5%ae%89%e8%a3%85xdebug%e5%8f%8a%e9%85%8d%e7%bd%ae/" aria-label="阅读 Ubuntu12.04下安装Xdebug及配置">阅读更多</a>]]></description>
										<content:encoded><![CDATA[<p><strong>一: 安装xdebug，这里用pecl</strong></p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install php-pear   
sudo apt-get install php5-dev
sudo pecl install xdebug
</pre>
<p><strong>二: 配置xdebug</strong><br />
<span id="more-1614"></span></p>
<pre class="brush: plain; title: ; notranslate">
cd /etc/php5/apche2/
vi php.ini
</pre>
<p><strong>在php.ini 中加入</strong></p>
<pre class="brush: plain; title: ; notranslate">
&#x5B;php_xdebug]
zend_extension = &quot;/usr/lib/php5/20090626/xdebug.so&quot;
</pre>
<pre class="brush: plain; title: ; notranslate">
sudo pecl install xdebug
</pre>
<p>在执行以上命令到最后会提示你的xdebug.so的所在目录。</p>
<p>此外，还需在使用xdebug之前，在php.ini中指定5个xdebug特定属性</p>
<pre class="brush: plain; title: ; notranslate">
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=&quot;/var/log/xdebug&quot;
xdebug.profiler_append=On
xdebug.profiler_output_name = &quot;cachegrind&quot;
</pre>
<p>注意在xdebug.profiler_output_dir = &#8220;/var/log/xdebug&#8221;随后需要创建文件夹</p>
<pre class="brush: plain; title: ; notranslate">
cd /var/log
mkdir xdebug
chmod 777 xdebug -R
</pre>
<p>然后将PHP配置文件的html_errors开启，将错误提示清晰化显示，默认为Off</p>
<pre class="brush: plain; title: ; notranslate">
html_errors = Off
</pre>
<p>改为</p>
<pre class="brush: plain; title: ; notranslate">
html_errors = On
</pre>
<p><strong>参数说明：</strong><br />
xdebug.profiler_enable<br />
#开启（1）或关闭（0）性能分析工具<br />
xdebug.profiler_output_dir=&#8221;/var/log/xdebug&#8221;<br />
#设定效能监测信息输出文件的路径，默认路径为/tmp<br />
xdebug.profiler_output_name<br />
#所用的文件名称<br />
xdebug.profiler_append<br />
#对php脚本发出新请求时，覆盖文件（1），默认情况下此设置为关（0）<br />
xdebug.profiler_enable_trigger<br />
#允许性能分析工具开始使用一个GET/POST 或 COOKIE变量：XDEBUG_PROFIKE。xdebug.profiler_enable必须设置为0</p>
<p>具体的配置可以参考：http://xdebug.org/docs/all_settings<br />
注意：输出目录要预先建好，否则不会输出内容。<br />
重启web服务器(或php-fpm)后，在phpinfo中查看是否有xdebug的信息，有的话就成功了。</p>
<p><a href="http://www.mudbest.com/ubuntu12-04%e4%b8%8b%e5%ae%89%e8%a3%85xdebug%e5%8f%8a%e9%85%8d%e7%bd%ae/2012-10-26-xdebug/" rel="attachment wp-att-1616"><img decoding="async" src="http://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug-1024x819.png" alt="" title="2012-10-26-xdebug" width="640" height="511" class="alignnone size-large wp-image-1616" srcset="https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug-1024x819.png 1024w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug-537x430.png 537w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug.png 1280w" sizes="(max-width: 640px) 100vw, 640px" /></a></p>
<p><a href="http://www.mudbest.com/ubuntu12-04%e4%b8%8b%e5%ae%89%e8%a3%85xdebug%e5%8f%8a%e9%85%8d%e7%bd%ae/2012-10-26-xdebug-2/" rel="attachment wp-att-1620" target="_blank"><img decoding="async" src="http://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug1-1024x819.png" alt="" title="2012-10-26-xdebug" width="640" height="511" class="alignnone size-large wp-image-1620" srcset="https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug1-1024x819.png 1024w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug1-537x430.png 537w, https://www.mudbest.com/wp-content/uploads/2012/10/2012-10-26-xdebug1.png 1280w" sizes="(max-width: 640px) 100vw, 640px" /></a></p>
<p>三.安装kcachegrind</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install kcachegrind
</pre>
<p>至此，你就可以用kcachegrind,webgrind 来分析你的PHP代码了。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
