<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/xsl/rss.xsl" type="text/xsl" media="screen"?>
<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:ppp="http://blog.sohu.com/rss/module/ppp/"
	>

	<channel>
		<title>生活加油站</title>
		<link>http://cblx.blog.sohu.com/</link>
		<description><![CDATA[不断给前进的生命之车加油助燃]]></description>
		<pubDate>Mon, 21 Jul 2008 17:02:47 +0800</pubDate>
		<generator>搜狐博客</generator>
		<ppp:ebi>9e9a525792</ppp:ebi>
		<image>
			<title>http://blog.sohu.com</title>
			<url>http://js.pp.sohu.com/ppp/blog/images/common/logo_150_60.gif</url>
			<link>http://blog.sohu.com/</link>
			<width>100</width>
			<height>43</height>
			<description>搜狐博客</description>
		</image>
		<item>
			<title>mysql+php乱码原理与解决</title>
			<link>http://cblx.blog.sohu.com/95150906.html</link>
			<comments>http://cblx.blog.sohu.com/95150906.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Mon, 21 Jul 2008 17:02:47 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/95150906.html</guid>
			<description><![CDATA[<div><strong><font size="5">
<h2>mysql+php乱码原理与解决</h2>
<div><strong>mysql+php产生乱码原因: <br /></strong>
<ul>
<li>mysql数据库默认的编码是utf8,如果这种编码与你的PHP网页不一致,可能就会造成MYSQL乱码. 
</li><li>MYSQL中创建表时会让你选择一种编码,如果这种编码与你的网页编码不一致,也可能造成MYSQL乱码. 
</li><li>MYSQL创建表时添加字段是可以选择编码的,如果这种编码与你的网页编码不一致,也可能造成MYSQL乱码. 
</li><li>用户提交页面的编码与显示数据的页面编码不一致,就肯定会造成PHP页面乱码. 
</li><li>如用户输入资料的页面是big5码, 显示用户输入的页面却是gb2312,这种100%会造成PHP页面乱码. 
</li><li>PHP页面字符集不正确. 
</li><li>PHP连接MYSQL数据库语句指定的编码不正确.</li></ul><font color="#ff0000"><strong>注意:</strong> </font><br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<i><u>很多人都怀疑mysql版本不一致会导致乱码,相信看了本说明你就不会这样认为了.</u> </i><br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 平时你在某些网站看到的文字可能有几种编码, 如你看到一个繁体字,它有可能是big5编码,也有 可能是utf-8编码的,更有可能是gb码的,没错,也就是说有简体编码的繁体字,也有繁体编码的简体字,一定要了解这一点. <br />如果你是做一个简体编码的网页,编码定为GB2312,如果有香港和台湾地区的访客提交繁体的信息,就可能会造成乱码,解决方法: <br />
<ul>
<li>将网站编码设为 utf-8,这样可以兼容世界上所有字符, 
</li><li>如果网站已经运作了好久,已有很多旧数据,不能再更改简体中文的设定,那么建议将页面的编码设为 GBK, GBK与GB2312的区别就在于:GBK能比GB2312显示更多的字符,要显示简体码的繁体字,就只能用GBK.</li></ul><br /><br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;使用mysql+php产生乱码的原因都了解得很清楚了,那么解决就不困难了. <br /><br /><strong>mysql+php产生乱码的解决办法:</strong> <br /><br />
<ul>
<li>如果安装mysql的编码已不能更改,很多朋友是购买<span>虚拟主机</span>建立网站,无权更改MYSQL的安装编码,这一关我们可以跳过,因为只要后面的步聚正确,一样能解决乱码问题 
</li><li>修改数据库编码，如果是数据库编码不正确,可以在phpmyadmin 执行如下命令: <br /><br />
<p align="center"><strong>ALTER DATABASE 'test' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin</strong> <br /><br /></p>以上命令就是将test数据库的编码设为utf8. 
</li><li>修改表的编码：<br /><br />
<p align="center"><strong>ALTER TABLE 'category' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin</strong> <br /><br /></p>以上命令就是将一个表category的编码改为utf8. 
</li><li>修改字段的编码： <br /><br />
<p align="center"><strong>ALTER TABLE 'test' CHANGE 'dd' 'dd' VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL </strong><br /><br /></p>以上命令就是将test表中 dd的字段编码改为utf8. 
</li><li>如果是这种情况容易解决，只需检查下页面，修改源文件的charset即可. 
</li><li>这种情况也是修改页面charset即可. 
</li><li>在连接数据库的语句中.</li></ul>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;mysql_connect('localhost','user','password'); <br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;mysql_select_db('my_db'); <br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;mysql_query(&quot;set names utf8;&quot;);&nbsp; &nbsp;&nbsp;&nbsp;//select 数据库之后加多这一句 <br /><br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;为了避免PHP页面乱码的发生，PHP页面开始第一句 <br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;header(&quot;content-type:text/html; charset=utf-8&quot;); <br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//强行指定页面的编码，以避免乱码 <br /><br /><br /><font color="#ff0000"><strong>注意:</strong> </font><br />&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;照以上方法修改以后只能保证你新插入的数据不会乱码,举个例:如果你用户已提交的数据是BIG5,你却想通过以上方法改为可以在GB2312的网页正确显示是不可能的, 这种文字内码的变换只能通过另写程序来解决.</div></font></strong></div>]]></description>
		</item>
		    
		
		<item>
			<title>php连接mysql出现乱码解决办法</title>
			<link>http://cblx.blog.sohu.com/95150160.html</link>
			<comments>http://cblx.blog.sohu.com/95150160.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Mon, 21 Jul 2008 16:55:47 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/95150160.html</guid>
			<description><![CDATA[<div>
<p><strong><font size="5">常用解决方法</font></strong></p>
<p>通常html模板（或含html输出的php）编码为 <font color="#ff00ff">ANSI</font> 或 <font color="#ff00ff">GB2312</font></p>
<p>php方面需做以下设置：</p>
<p>1. 在phpmyadmin数据库首页，确保 </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; MySQL 字符集: UTF-8 Unicode (utf8)&nbsp;&nbsp;&nbsp;&nbsp; (注：这个在这里不能改)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; MySQL 连接校对: <font color="#ff00ff">utf8_general_ci</font></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 这样一来，新建的数据库的表中的字段，整理都自动设为utf8_general_ci</p>
<p>&nbsp;&nbsp;&nbsp; <font color="#008080">（注：可以使phpmyadmin中的中文正常显示。）</font></p>
<p>2. 在php中连接mysql后加上 <font color="#ff00ff">mysql_query(&quot;SET NAMES 'gb2312'&quot;);</font></p>
<p>***********************************************************************************************************************************</p>
<p><font size="5"><strong>通用解决方法</strong></font></p>
<p><font size="2">1. 所有 <font color="#ff0000"><font color="#ff00ff">php/html</font> </font>文件以 <font color="#ff00ff">UTF-8</font> 编码保存 (注：可在编辑器中将UTF-8设为默认编码)</font></p>
<p><font size="2">2. 在phpmyadmin数据库首页，确保 </font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; MySQL 字符集: <strong>UTF-8 Unicode (utf8)&nbsp;&nbsp;&nbsp;&nbsp; </strong>(注：这个在这里不能改)</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; MySQL 连接校对: <font color="#ff00ff">utf8_general_ci</font></font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; 这样一来，新建的数据库的表中的字段，整理都自动设为utf8_general_ci</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;<font color="#33cccc">&nbsp;</font><font color="#008080">（注：可以使phpmyadmin中的中文正常显示。）</font></font></p>
<p><font size="2">3. 在php里加上</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff00ff">header(&quot;content-type:text/html; charset=utf-8&quot;);</font>&nbsp;&nbsp;&nbsp;&nbsp;（注：header语句前不能有任何输出，包括空格）</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp; <font color="#008080">（注：指定客户端输出时编码，中文操作系统浏览器默认为gb2312）</font></font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; <font color="#ff00ff">mysql_query(&quot;SET NAMES 'UTF8'&quot;);</font></font></p>
<p><font size="2">&nbsp;</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp; <strong>如下面</strong>config.ini.php：</font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#3366ff" size="2">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; header(&quot;content-type:text/html; charset=utf-8&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></p>
<p><font color="#3366ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dbhost&nbsp;&nbsp;&nbsp;= 'localhost';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dbname&nbsp; = 'ticketsystem';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dbusr&nbsp;&nbsp;&nbsp;= 'root';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dbpsw&nbsp;&nbsp;&nbsp;= '123';<br />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql_connect($dbhost,$dbusr,$dbpsw);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql_query(&quot;SET NAMES 'UTF8'&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql_select_db($dbname);<br />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;//其它配置<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?&gt;</font></p>
<p><font size="2">同理可设置为gb2312，gbk等。</font></p>
<p><font color="#008080" size="2">注意：header(&quot;content-type:text/html; charset=utf-8&quot;);&nbsp;&nbsp; 只能在php中使用</font></p>
<p><font color="#008080" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在单纯html中可以考虑使用:</font></p>
<p><font color="#008080" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;</font></p>
<p><font color="#ff9900"></font><font size="2">&nbsp;</font></p>
<p><font size="2">&nbsp;</font></p></div>
<div>
<p><font size="2">***********************************************************************************************************************************</font></p></div>]]></description>
		</item>
		    
		
		<item>
			<title>php mysql乱码解决(有效)</title>
			<link>http://cblx.blog.sohu.com/95148886.html</link>
			<comments>http://cblx.blog.sohu.com/95148886.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Mon, 21 Jul 2008 16:41:36 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/95148886.html</guid>
			<description><![CDATA[<p>1.数据库尽量使用utf8存储（修改/etc/my.cnf，在[mysqld]段加上default-character-set=utf8） <br />(已有的数据库，先转成UTF8格式) <br />2.PHP程序在查询数据库之前，执行<font color="#ff0000">mysql_query(&ldquo;set names xxxx&rdquo;);</font>其中xxxx是你网页的编码(charset=xxxx)，如果网页中charset=utf8，则xxxx=utf8，如果网页中charset=gb2312，则xxxx=gb2312，如果网页中的charset=ipaddr，则xxxx=ipaddr (开个玩笑，没这编码) <br />几乎所有WEB程序，都有一段连接数据库的公共代码，放在一个文件里，在这文件里，加入mysql_query(&ldquo;set names&rdquo;)就可以了。 <br />3.PHPMyAdmin不需要做改动。 <br />4.需要注意的是，为保证网页实际编码(Windows保存对话框里的编码)和他声明的编码(charset=?)是一致的，请用DW之类的工具做网页。</p>
<p>&nbsp;</p>
<p><font size="2"><strong>mysql+php产生乱码的解决办法:</strong> <br /><br /></font></p>
<ol>
<li><font size="2">如果安装mysql的编码已不能更改,很多朋友是购买虚拟主机建立网站,无权更改MYSQL的安装编码,这一关我们可以跳过,因为只要后面的步聚正确,一样能解决乱码问题 </font>
</li><li><font size="2">修改数据库编码，如果是数据库编码不正确,可以在phpmyadmin 执行如下命令: <br /><br /></font>
<div align="center"><font size="2"><strong>ALTER DATABASE 'test' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin</strong> <br /><br /></font></div><font size="2">以上命令就是将test数据库的编码设为utf8.<br /></font>
</li><li><font size="2">修改表的编码：<br /><br /></font>
<div align="center"><font size="2"><strong>ALTER TABLE 'category' DEFAULT CHARACTER SET utf8 COLLATE utf8_bin</strong> <br /><br /></font></div><font size="2">以上命令就是将一个表category的编码改为utf8.<br /></font>
</li><li><font size="2">修改字段的编码： <br /><br /></font>
<div align="center"><font size="2"><strong>ALTER TABLE 'test' CHANGE 'dd' 'dd' VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL </strong><br /><br /></font></div><font size="2">以上命令就是将test表中 dd的字段编码改为utf8.<br /></font>
</li><li><font size="2">如果是这种情况容易解决，只需检查下页面，修改源文件的charset即可. </font>
</li><li><font size="2">这种情况也是修改页面charset即可. </font>
</li><li><font size="2">在连接数据库的语句中. </font></li></ol>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ff0000"> mysql_connect('localhost','user','password'); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql_select_db('my_db'); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>mysql_query(&quot;set names utf8;&quot;);</strong></font>&nbsp;&nbsp;&nbsp;&nbsp; //select 数据库之后加多这一句 <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 为了避免PHP页面乱码的发生，PHP页面开始第一句 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp;<strong> header(&quot;content-type:text/html; charset=utf-8&quot;);</strong> <br /></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //强行指定页面的编码，以避免乱码 <br /></font></p>]]></description>
		</item>
		    
		
		<item>
			<title>PHP显示MySQL乱码问题</title>
			<link>http://cblx.blog.sohu.com/95096071.html</link>
			<comments>http://cblx.blog.sohu.com/95096071.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Mon, 21 Jul 2008 16:52:50 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/95096071.html</guid>
			<description><![CDATA[<p>&radic; 乱码问题1. 用PHPmyAdmin操作MySQL数据库汉字显示正常 ，但用PHP网页显示MySQL数据时所有汉字都变成了?号。</p>
<p>&nbsp;&nbsp;&nbsp; 症状：用PHPmyAdmin输入汉字正常，但当PHP网页显示MySQL数据时汉字就变成了?号，并且有多少个汉字就有多少个?号。很多学员都遇到了此问题，尤其是在安装了最新版的Appserv后。为此许多学员放弃了PHP，改学ASP了。</p>
<p>&nbsp;&nbsp;&nbsp; 原因：没有在PHP网页中用代码告诉MySQL该以什么字符集输出汉字。</p>
<p>&nbsp;&nbsp;&nbsp; ★ 解决方法：这不是乱码，只要在PHP网页头部加入以下一段代码告诉MySQL以UTF8编码输出汉字即可<br />&lt;? mysql_query(&quot;SET NAMES UTF8&quot;);&nbsp; ?&gt; <br />&nbsp;&nbsp;&nbsp; 你也可以在网页中PHP代码部分直接插入上述代码片段（即去掉两端&lt;??&gt;号）。例如你用Dreamweaver连接数据库，那么可以在头部的连接代码<br />&lt;?php require_once(&amp;#39;Connections/connmessage.php&amp;#39;); ?&gt;中加入该代码使其变成&lt;?<br />php require_once(&amp;#39;Connections/connmessage.php&amp;#39;); <br />mysql_query(&quot;SET NAMES UTF8&quot;); <br />&nbsp; ?&gt;</p>
<p>&nbsp;&nbsp;&nbsp; 注意：如果你的网页编码是gb2312，那就是 SET NAMES GB2312。但编辑员强烈推荐网页编码、MySQL数据表字符集、PHPmyAdmin都统一使用UTF8。原因请见本站PHP教程第一章第2节。</p>
<p>&nbsp;&nbsp; &radic; 乱码问题2. 用PHPmyAdmin输入数据时发生错误，不让输入或出现乱码</p>
<p>&nbsp;&nbsp; ★ 解决方法：这是设置问题。请安装最新版PHPmyAdmin或Appserv，打开PHPmyAdmin，MySQL 字符集: UTF-8 Unicode (utf8)； MySQL 连接校对应该为utf8_unicode_ci；创建新的数据库时整理一栏请也选成utf8_unicode_ci。网页字符集也最好选用utf8。utf8是国际标准编码，是趋势。怎样更改网页编码请看本站PHP教程第一章第2节。</p>
<p>&nbsp;&nbsp;&nbsp; &radic; 乱码问题3. 在本机开发好的MySQL数据表，在本机测试一切正常，但用网站空间商提供的PHPmyAdmin上传时却出现问题，上传失败。尤其是使用国外PHP空间。</p>
<p>&nbsp;&nbsp; ★ 解决方法：首先查看网站空间商提供的PHPmyAdmin字符集设定，确定自己所建数据表与空间是同一编码。在国外MySQL是不支持gb2312的，甚至最新版的Appserv也不支持gb2312。如果是因为编码不统一，可以重建数据表，当然是用国际标准的UTF8。 </p>
<p>-----------------------------------</p>
<p>--------------------------------------</p>
<p>用phpmyadmin添加mysql数据库，然后用php操作数据库出现乱码的解决办法：<br />1：确认phpmyadmin用的mysql字符集为utf-8 unicode（utf8）；mysql连接校对为</p>
<p>utf8_general_ci,language为中文-chinese simplified<br />2：确认每个数据表的&ldquo;整理为&rdquo;utf8_general_ci；<br />3：在php连接mysql数据库后加个语句来指定数据库的字符集，<br />&nbsp;&nbsp; 例如：$conn=mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;你的密码&quot;); //连接数据库<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql_query(&quot;set name 'utf8'&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //指定数据库的字符集为utf8</p>]]></description>
		</item>
		    
		
		<item>
			<title>设置mysql数据库的编码</title>
			<link>http://cblx.blog.sohu.com/95093576.html</link>
			<comments>http://cblx.blog.sohu.com/95093576.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Sun, 20 Jul 2008 23:39:30 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/95093576.html</guid>
			<description><![CDATA[<h4 style="MARGIN-BOTTOM: 0px">设置mysql数据库的编码</h4>
<div>
<ol>
<li>在my.cf文件的[mysqld]段设置：<br />default-character-set=utf8<br />
</li><li>单独设置某个数据库：<br />alter database testdb character set utf8;<br />
</li><li>查看mysql支持的编码：<br />show character set;</li></ol></div>]]></description>
		</item>
		    
		
		<item>
			<title>经典</title>
			<link>http://cblx.blog.sohu.com/93693376.html</link>
			<comments>http://cblx.blog.sohu.com/93693376.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Fri, 4 Jul 2008 19:54:46 +0800</pubDate>
			<guid>http://cblx.blog.sohu.com/93693376.html</guid>
			<description><![CDATA[1.帅有个屁用!到头来还不是被卒吃掉! <br />　　2.你是电，李四光，你是唯一的神话&hellip; <br />　　3.不怕被人利用，就怕你没用。 <br />　　4.我的人这么多，你算老几? <br />　　5.人生自古谁无死，哪个拉屎不用纸。 <br />　　6.不蒸馒头争口气行吗？ <br />　　7.生的伟大，死在花下！ <br />　　8.有钱人终成眷属。 <br />　　9.废话是人际关系的第一句。<br />　　10.只要锄头舞的好，那有墙角挖不倒？ <br />　　11.要在江湖混，最好是光棍！！ <br />　　12.大部分人一辈子只做三件事：自欺、欺人、被人欺。 <br />　　13.不要和我比懒，我懒得和你比 <br />　　14.别人的钱财乃我的身外之物。 <br />　　15.女为悦己者容男为悦己者穷！ <br />　　16.是金子，总会花光的；是镜子，总会反光的&hellip; <br />　　17.天赐你一双翅膀，就应该被红烧&hellip; <br />　　18.唯女人与英语难过也，唯老婆与工作难找也]]></description>
		</item>
		    
		
		<item>
			<title>Linux系统上把PHP编译进Apache静态内核【转】</title>
			<link>http://cblx.blog.sohu.com/85804371.html</link>
			<comments>http://cblx.blog.sohu.com/85804371.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Sun, 27 Apr 2008 17:01:46 +0800</pubDate>
			<category>电脑技术</category>
			<guid>http://cblx.blog.sohu.com/85804371.html</guid>
			<description><![CDATA[<p>说明：Apache整合PHP有两种方式：一种是DSO模式，把PHP当作Apache的外部模块来调用，这样增加了Apache的灵活性，但会带来5%的性能降低；另一种方式是把PHP编译进Apache的内核，这样牺牲了以后调整的灵活性（每次对PHP的重新编译，都需要再次编译Apache）， </p>
<p><br />但性能会高一些。对Perl也是如此。相比之下，本人更愿意使用第二种方式，即把PHP编译进Apache的静态内核。 </p>
<p><br />一.编译Apache： </p>
<p><br />1. 进入Apache展开目录； </p>
<p><br />2. ./configure - -prefix=/usr/local/apache1.3 - -disable-module=all\ </p>
<p><br />- -enable-module=access - -enable-module=log_config \ </p>
<p><br />- -enable-module=dir - -enable-module=mime \ ##Apache工作的基本模块 </p>
<p><br />（说明：如果以后使用DSO方式，则编译时加上 - -enable-mdule=so） </p>
<p><br />二.安装PHP： </p>
<p><br />1. 进入PHP展开目录； </p>
<p><br />2. ./configure - -prefix=/usr/local/php4 \ </p>
<p><br />- -with-apache=../apache_1.3.27 ##这里指定Apache的源代码目录 </p>
<p><br />3. make;make install </p>
<p><br />三.安装Apache： </p>
<p><br />1. 进入Apache展开目录； </p>
<p><br />2. ./configure - -prefix=/usr/local/apache1.3 - -disable-module=all \ </p>
<p><br />- -enable-module=access - -enable-module=log_config \ </p>
<p><br />- -enable-module=dir - -enable-module=mime \ </p>
<p><br />- -activate-module=src/modules/php4/libphp4.a ##把PHP模块编译进去 </p>
<p><br />3. make;make install </p>
<p><br />四。配置Apache： </p>
<p><br />修改httpd.conf文档： </p>
<p><br />1.Timeout 300---&gt;Timeout 120 </p>
<p><br />2.MaxKeepAliveRequests 100 </p>
<p><br />3.KeepAliveTimeout 5 </p>
<p><br />4.ServerSignature on---&gt;ServerSignature off </p>
<p><br />5.Options Indexes FollowSymLinks 行把indexes删掉（目录的Options不要带index选项） </p>
<p><br />6.将Apache运行的用户和组改为nobody </p>
<p><br />7.MaxClients 150&mdash;&mdash;&gt;MaxClients 1500 </p>
<p><br />（该参数是多少有一个基本的算法，例如2G的机器，一个Apache＋PHP进程大概消耗4M内存，则最高效率的进程数为2g/4m * 2=1000，最大进程数为1000*1.5=1500；1.3下要调整到高于256须在编译Apache前修改其源代码） </p>
<p><br />（对apache2.0版本，将worker MPM字段里的MaxClients 150&mdash;&mdash;&gt;MaxClients 1500） </p>
<p><br />8.DirectoryIndex index.html index.html.var 后面加上index.php </p>
<p><br />9.查找包含大量AddType命令的小节，添加下面这一行： AddType application/x-httpd-php .php </p>
<p><br />Apache版本：Apache-2.0.47 </p>
<p><br />PHP版本：PHP-4.3.2 </p>
<p><br />a.安装Apache： </p>
<p><br />进入Apache安装目录； </p>
<p><br />./configure - -prefix=/usr/local/apache2 - -enable-so </p>
<p><br />make;make install </p>
<p><br />b.安装PHP： </p>
<p><br />进入PHP安装目录； </p>
<p><br />./configure - -prefix=/usr/local/php4 - </p>
<p><br />-with-apxs2=/usr/local/apache2/bin/apxs </p>
<p><br />make;make install </p>
<p><br />c.配置Apache： </p>
<p><br />修改httpd.conf，上述配置工作照做； </p>
<p><br />另外修改的地方： </p>
<p><br />LoadModule php4_module modules/libphp4.so （这一项在装完php后会自动添加） </p>
<p><br />AddType application/x-httpd-php .php （这一项手工添加） </p>
<p><br />本文来自：中国建站网(www.136z.com)原文链接：http://edu.136z.com/Server/37179.html</p>]]></description>
		</item>
		    
		
		<item>
			<title>Apache如何设置才能拒绝目录列表[转]</title>
			<link>http://cblx.blog.sohu.com/85804248.html</link>
			<comments>http://cblx.blog.sohu.com/85804248.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Sun, 27 Apr 2008 17:00:13 +0800</pubDate>
			<category>电脑技术</category>
			<guid>http://cblx.blog.sohu.com/85804248.html</guid>
			<description><![CDATA[在httpd.conf中 &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; 对于目录权限的设定中 &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; Options项不要加Indexes]]></description>
		</item>
		    
		
		<item>
			<title>LAMP安装[转]</title>
			<link>http://cblx.blog.sohu.com/85759000.html</link>
			<comments>http://cblx.blog.sohu.com/85759000.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Sat, 26 Apr 2008 23:45:41 +0800</pubDate>
			<category>电脑技术</category>
			<guid>http://cblx.blog.sohu.com/85759000.html</guid>
			<description><![CDATA[<p><strong><font color="#006699">由于服务器的linux版本太低，apache+php+mysql版本都太低，初次学习linux经过三天除了吃饭睡觉终于把apache+php+mysql给升级了！现说下升级过程：</font></strong></p>
<p><strong><font color="#006699">一删除apache+php+mysql：</font></strong></p>
<p><strong><font color="#006699">判断是不是rpm安装如：rpm -q php 返回php版本，则是rpm安装，用 rpm -e php --nodeps 即可彻底删除系统自带的php<br />如果不返回PHP版本则是二进制安装，直接删除目录就可以！同理apache mysql也一样！</font></strong></p>
<p><strong><font color="#006699">二安装apache</font></strong></p>
<p><strong><font color="#006699">下载httpd-2.2.4.tar.gz </font></strong></p>
<p><strong><font color="#006699">tar xzvf httpd-2.2.4.tar.gz<br />cd httpd-2.2.4<br />./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --enable-cgi --enable-rewrite --enable-deflate --with-mpm=worker<br />make<br />make install</font></strong></p>
<p><strong><font color="#006699">三 安装mysql</font></strong></p>
<p><br /><strong><font color="#006699"># chmod 755 mysql-5.0.45-linux-i686-glibc23.tar.gz&nbsp;&nbsp; //设置mysql-5.0.45-linux-i686-glibc23.tar.gz属性为755<br /># tar xzvf mysql-5.0.45-linux-i686-glibc23.tar.gz //解压<br /># cp -r mysql-5.0.45-linux-i686-glibc23 /usr/local&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //<br /># mv mysql-5.0.45-linux-i686-glibc23 mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //<br /># cd mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //<br /># groupadd mysql // 建立mysql组<br /># useradd mysql -g mysql //建立mysql用户并且加入到mysql组中<br /># cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf <br />在 support-files目录下有4个模版文件，我们选择其中一个座位Mysql的配置文件，覆盖/etc/my.cnf(系统默认的配置，其中设置了性能参数和Mysql的一些路径参数) <br /># cd /usr/local/mysql 进入mysql目录 <br /># ./scripts/mysql_install_db --user=mysql //初试化表并且规定用mysql用户来访问。初始化表以后就开始给mysql和root用户设定访问权限 <br /># chown -R root&nbsp;&nbsp; //设定root能访问/usr/local/mysql&nbsp;&nbsp; <br /># chown -R mysql data //设定mysql用户能访问/usr/local/mysql/data&nbsp;&nbsp; 里面存的是mysql的数据库文件.这个目录是在/etc/my.cnf中有配置，在mysql_install_db时产生。&nbsp;&nbsp; <br /># chown -R mysql data/&nbsp;&nbsp;&nbsp; //设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件 <br /># chgrp -R mysql //设定mysql组能够访问/usr/local/mysql <br /># /usr/local/mysql/bin/mysqld_safe --user=mysql &amp;&nbsp;&nbsp; 运行mysql 如果没有问题的话,应该会出现类似这样的提示:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [1] 42264<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Starting mysqld daemon with databases from /usr/local/mysql/var <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果出现 mysql ended这样的语句，表示Mysql没有正常启动，你可以到log中查找问题，Log文件的通常在/etc/my.cnf中配置。大多数问题是权限设置不正确引起的。 <br /># /usr/local/mysql/bin/mysqladmin -u root password yourpassword&nbsp;&nbsp; //默认安装密码为空，为了安全你必须马上修改. <br /># cp support-files/mysql.server /etc/rc.d/init.d/mysqld 设置使mysql每次启动都能自动运行<br /># chmod 700 /etc/init.d/mysqld<br /># chkconfig --add mysqld<br /># chkconfig --level 345 mysqld on<br /># service mysqld start //启动mysqld服务 <br /># netstat -atln //查看3306端口是否打开。要注意在防火墙中开放该端口。 </font></strong></p>
<p><strong><font color="#006699">四安装php</font></strong></p>
<p><strong><font color="#006699">1. 安装zlib (安装libpng和gd前需要先安装zlib)，<br /># tar zxvf zlib-1.2.3.tar.gz<br /># cd zlib-1.2.3<br /># ./configure<br /># make;make install</font></strong></p>
<p><strong><font color="#006699">2. 安装libpng，<br /># tar zxvf libpng-1.2.12.tar.gz<br /># cd libpng-1.2.12<br /># ./configure<br /># make;make install</font></strong></p>
<p><strong><font color="#006699">3. 安装freetype，<br /># tar zxvf freetype-2.2.1.tar.gz<br /># cd freetype-2.1.10<br /># ./configure --prefix=/usr/local/freetype<br /># make;make install</font></strong></p>
<p><strong><font color="#006699">4. 安装jpeg，<br /># tar zxvf jpegsrc.v6b.tar.gz<br /># cd jpeg-6b<br /># mkdir /usr/local/jpeg<br /># mkdir /usr/local/jpeg/bin<br /># mkdir /usr/local/jpeg/lib<br /># mkdir /usr/local/jpeg/include<br /># mkdir /usr/local/jpeg/man<br /># mkdir /usr/local/jpeg/man/man1<br /># ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static<br /># make;make install</font></strong></p>
<p><strong><font color="#006699">5. 安装gd，<br /># tar zxvf gd-2.0.35.tar.gz <br /># cd gd-2.0.35<br /># ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-png --with-zlib<br />//编译过程中会看到如下信息<br />** Configuration summary for gd 2.0.33:</font></strong></p>
<p><strong><font color="#006699">&nbsp;&nbsp; Support for PNG library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br />&nbsp;&nbsp; Support for JPEG library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br />&nbsp;&nbsp; Support for Freetype 2.x library: yes<br />&nbsp;&nbsp; Support for Fontconfig library:&nbsp;&nbsp; no<br />&nbsp;&nbsp; Support for Xpm library:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no<br />&nbsp;&nbsp; Support for pthreads:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br />//可以看到png 、 jpeg 、 freetype都已经安装上了<br /># make <br /># make install</font></strong></p>
<p><strong><font color="#006699">6. 正式安装php<br /># tar zxvf php-5.2.3.tar.gz<br /># cd php-5.2.3<br /># ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-zlib --with-libpng --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --enable-sockets --with-iconv --enable-mbstring --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=/usr/local/php5/etc<br /># make <br /># make install</font></strong></p>
<p><br /><strong><font color="#006699">7.整合php和apache<br />cp php.ini-dist /usr/local/php5/etc/php.ini <br />vi /usr/local/php5/etc/php.ini<br />将extension=php_mysql.dll前面的#去掉<br />注意在/usr/local/php5/etc/php.ini加上下代码使apache执行PHP</font></strong></p>
<p><strong><font color="#006699">AddType application/x-httpd-php .php<br />AddType application/x-httpd-php3 .php3<br />AddType application/x-httpd-php4 .php4 <br />AddType application/x-httpd-php-source .phps </font></strong></p>
<p></p>
<p><br /><strong><font color="#006699">8. 安装ZendOptimizer，<br /># tar zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz<br /># cd ZendOptimizer-3.0.1-linux-glibc21-i386<br /># ./install.sh</font></strong></p>]]></description>
		</item>
		    
		
		<item>
			<title>linux root 密码忘了怎么办？ </title>
			<link>http://cblx.blog.sohu.com/85169421.html</link>
			<comments>http://cblx.blog.sohu.com/85169421.html#comment</comments>
			<dc:creator>生活加油站</dc:creator>
			<pubDate>Sun, 20 Apr 2008 12:36:19 +0800</pubDate>
			<category>电脑技术</category>
			<guid>http://cblx.blog.sohu.com/85169421.html</guid>
			<description><![CDATA[<p>介绍一个在所有版本linux的grub上均可以使用的方法：</p>
<p>1、在Grub的引导装载程序菜单上，选择你要进入的条目，键入 &ldquo;e&rdquo; 来进入编辑模式；<br /><br />2、在第二行（类似于kernel /vmlinuz-2.6.15 ro root=/dev/hda2 ），键入&rdquo;e&rdquo;进入编辑模式；<br /><br />3、在句末加上&rdquo;init=/bin/bash&rdquo;，回车；<br /><br />4、按&ldquo;b&rdquo;启动系统。</p>
<p>这样我们即可获得一个bash的shell，进入shell后，根分区的挂载模式默认是只读，我们要将其改为可写，否则不能更改root密码:</p>
<p>mount -no remount,rw /<br />passwd root<br />sync<br />mount -no remount,ro /<br />reboot</p>
<p>这样即可成功更改debian的root用户的密码。</p><span style="FONT-SIZE: 12px">本文链接：<a href="http://www.blueidea.com/computer/system/2007/4481.asp" target="_blank">http://www.blueidea.com/computer/system/2007/4481.asp</a>　<img src="http://www.blueidea.com/img/common/fin.gif" /></span> ]]></description>
		</item>
		    
		
	</channel>
</rss>
