<?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>Cgeek's blog</title>
	<atom:link href="http://www.cgeek.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.cgeek.org</link>
	<description>web 2.0  &#38; PHP  &#38; Network Security &#38; DBA &#38; Linux</description>
	<lastBuildDate>Thu, 18 Mar 2010 15:04:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zend Optimizer不起作用，又是SELinux搞得鬼</title>
		<link>http://www.cgeek.org/?p=442</link>
		<comments>http://www.cgeek.org/?p=442#comments</comments>
		<pubDate>Thu, 18 Mar 2010 15:03:53 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[Linux/c/c++]]></category>
		<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=442</guid>
		<description><![CDATA[今天一台linux服务器上遭遇Zend加密的php文件无法加密，可是我记得已经安装过Zend Optimizer的啊，phpinfo();查看了一下。发现没有Zend Optimizer;
打开php.ini，看到最后明明有zend扩展配置啊：
[Zend]
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
zend_optimizer.version=3.3.0a
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
找了好久，终于在运行完php -v的命令后找到了原因，提示：
[root@locoy 5_2_x_comp]# /usr/local/webserver/php/bin/php -v
Failed loading /usr/local/Zend/lib/Optimizer-3.3.0/php-5.2.x/ZendOptimizer.so:  /usr/local/Zend/lib/Optimizer-3.3.0/php-5.2.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied
PHP 5.2.10 (cli) (built: Dec  6 2009 01:35:07)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
    with [...]]]></description>
			<content:encoded><![CDATA[<p>今天一台linux服务器上遭遇Zend加密的php文件无法加密，可是我记得已经安装过Zend Optimizer的啊，phpinfo();查看了一下。发现没有Zend Optimizer;<br />
打开php.ini，看到最后明明有zend扩展配置啊：</p>
<p>[Zend]<br />
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so<br />
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so<br />
zend_optimizer.version=3.3.0a<br />
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0<br />
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0</p>
<p>找了好久，终于在运行完php -v的命令后找到了原因，提示：</p>
<p>[root@locoy 5_2_x_comp]# /usr/local/webserver/php/bin/php -v<br />
Failed loading /usr/local/Zend/lib/Optimizer-3.3.0/php-5.2.x/ZendOptimizer.so:  /usr/local/Zend/lib/Optimizer-3.3.0/php-5.2.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied<br />
PHP 5.2.10 (cli) (built: Dec  6 2009 01:35:07)<br />
Copyright (c) 1997-2009 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies<br />
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator<br />
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies</p>
<p>上网一搜，原来又是SELinux搞得鬼~~把selinux关了就可以，或者运行<br />
chcon -t texrel_shlib_t /usr/local/Zend/lib/Optimizer-3.3.0/php-5.2.x/ZendOptimizer.so</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=442</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MIME Types惹的祸（IE和Firefox处理MIME Types的区别）</title>
		<link>http://www.cgeek.org/?p=432</link>
		<comments>http://www.cgeek.org/?p=432#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:32:44 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[Linux/c/c++]]></category>
		<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[mime types]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=432</guid>
		<description><![CDATA[问题描述：
将一个站搬到新架设的服务器环境中. nginx + php + mysql + CentOS ,遇到一个奇怪的问题，IE下浏览正常，但是在火狐下完全乱的。用firebug查看css，提示 “该URL 的资源不是文本 css” &#8230;应该是无法读取css文件。开始以为是浏览器兼容问题，或者是css文件里面有语法错误&#8230;但是在本地测试环境里都是正常的啊？
问题分析：
通过抓包分析获取css的数据包（请求包 Request Headers 和响应包的Response Headers）,发现服务器响应包（Response Headers）的Content-Type属性为application/octet-stream;在火狐下直接输入css文件访问路径，发现弹出下载窗口&#8230;我记得在火狐下应该能直接查看css文件内容才对的啊~~~通过比较其他正常网站的css文件请求数据包，发现他们的Content-Type的属性是text/css~~~
于是怀疑是Content-Type的问题，查看nginx的配置文件nginx.conf
worker_processes  2;
error_log /var/log/nginx/error_log info;
events {
        worker_connections  1024;
        use epoll;
}
http {
        #include     [...]]]></description>
			<content:encoded><![CDATA[<p><strong>问题描述：</strong><br />
将一个站搬到新架设的服务器环境中. nginx + php + mysql + CentOS ,遇到一个奇怪的问题，IE下浏览正常，但是在火狐下完全乱的。用firebug查看css，提示 “该URL 的资源不是文本 css” &#8230;应该是无法读取css文件。开始以为是浏览器兼容问题，或者是css文件里面有语法错误&#8230;但是在本地测试环境里都是正常的啊？</p>
<p><strong>问题分析：</strong><br />
通过抓包分析获取css的数据包（请求包 Request Headers 和响应包的Response Headers）,发现服务器响应包（Response Headers）的Content-Type属性为application/octet-stream;在火狐下直接输入css文件访问路径，发现弹出下载窗口&#8230;我记得在火狐下应该能直接查看css文件内容才对的啊~~~通过比较其他正常网站的css文件请求数据包，发现他们的Content-Type的属性是text/css~~~<br />
于是怀疑是Content-Type的问题，查看nginx的配置文件nginx.conf</p>
<p>worker_processes  2;<br />
error_log /var/log/nginx/error_log info;<br />
events {<br />
        worker_connections  1024;<br />
        use epoll;<br />
}<br />
http {<br />
        #include         mime.types;<br />
        default_type    application/octet-stream;</p>
<p>        log_format main<br />
                &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8216;<br />
                &#8216;&#8221;$request&#8221; $status $bytes_sent &#8216;<br />
                &#8216;&#8221;$http_referer&#8221; &#8220;$http_user_agent&#8221; &#8216;<br />
                &#8216;&#8221;$gzip_ratio&#8221;&#8216;;<br />
        client_header_timeout   10m;<br />
        client_body_timeout     10m;<br />
        send_timeout            10m;<br />
        connection_pool_size            256;<br />
        client_header_buffer_size       1k;<br />
        large_client_header_buffers     4 2k;<br />
        request_pool_size               4k;<br />
&#8230;&#8230;&#8230;&#8230;<br />
        server {<br />
                listen 80;<br />
                server_name t.talkphp.net;<br />
                index index.html index.htm index.php;<br />
                root /var/www/htdocs/public;<br />
                location / {<br />
                    index index.php;</p>
<p>                    if (!-f $request_filename) {<br />
                        rewrite ^/(.+)$ /index.php?$1& last;<br />
                    }<br />
                }</p>
<p>                location ~ .*\.(php|php5)?$<br />
                {<br />
                    fastcgi_pass 127.0.0.1:9000;<br />
                    fastcgi_index index.php;<br />
                    include fcgi.conf;<br />
                }<br />
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$<br />
                {<br />
                    expires      30d;<br />
                }<br />
                location ~ .*\.(js|css)$<br />
                {<br />
                    expires      1h;<br />
                }</p>
<p>注意http { 后面<br />
        #include         mime.types;<br />
        default_type    application/octet-stream;<br />
看到了，默认是default_type是application/octet-stream，和抓包里显示的一样，可惜当初偷懒，拷贝别人的配置文件，把include mime.types给注释掉了。</p>
<p><strong>解决方法</strong>： 在nginx.conf中加入include mime.types;</p>
<p>火狐浏览器下访问页正常了，再一次抓包分析，现在css的响应数据包的Content-Type属性为text/css;</p>
<p><strong>进一步思考：</strong><br />
为什么IE浏览器下确是正常的呢？IE和火狐在处理MIME Types上有什么区别呢？<br />
google了一番，<br />
在msdn下找到如下描述：<a href="http://msdn.microsoft.com/en-us/library/ms775148(VS.85).aspx" target='_blank'>http://msdn.microsoft.com/en-us/library/ms775148(VS.85).aspx</a></p>
<p>Internet Explorer first consults the Content-Type and Content-Disposition headers for the MIME type from the HTTP server, if they exist. Next, Internet Explorer consults the registry entry for that MIME type under HKEY_CLASSES_ROOT\MIME\Database\Content Type and looks at the Extension key for the correct file extension. Internet Explorer then ensures that the file has that extension, before placing it in the local browser cache.</p>
<p>也就是说如果响应包的header没有指定Content-Type，IE也会先处理，会打开注册表的“HKEY_LOCAL_MACHINESOFTWAREClassesMIMEDatabaseContent Type”主键，你可以看到所有 MIME Type 的配置信息。</p>
<p>而Firefox的处理方式略有不同：找到依据如下：<a href="https://developer.mozilla.org/en/How_Mozilla_determines_MIME_Types">https://developer.mozilla.org/en/How_Mozilla_determines_MIME_Types</a><br />
For HTTP URIs Mozilla usually gets a MIME type sent from the server, and uses it. Contrary to Internet Explorer&#8217;s MIME type guessing, <strong>Mozilla will generally not sniff the type of the document. </strong></p>
<p><strong>MIME是什么东东？</strong><br />
MIME是多用途的网际邮件扩充协议的缩写。对于诸如网络服务器或者浏览器程序来说，按照MIME类型将页面内容分类是一种标准方法，并且这些程序都含有一个MIME类型列表以便于在跨做操作系统的环境下用相同的方法传输同类型文本内容。<br />
    当某一服务器中的一个页面需要读取远程CSS文件的时候，根据MIME类型的定义（通常情况下是”text/css”），这个样式表文件带有.css的文件扩展名。然而服务器有时却会错误的将.css文件的MIME类型判断为”text/plain”或者是”text/html”。因此当一个标准编译下的页面（也就是采用完整文档声明的页面）调用这个CSS文件的时候就会被判别为不相符的MIME类型，此时基于Gecko的浏览器就会忽略远程样式表，与我们事先想象中那样美丽的网页相反，它们会将页面展现为无任何样式定义的样子。</p>
<p>其他相关链接：<br />
<a href="http://hi.baidu.com/sunblackshine/blog/item/8f97e60056a70ddd277fb5a1.html">MIME类型导致css在Firefox下无效</a><br />
<a href="http://hi.baidu.com/may2rd/blog/item/326d12e78721642db8382011.html">什么是 MIME Type？</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=432</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>error: No curses/termcap library found</title>
		<link>http://www.cgeek.org/?p=430</link>
		<comments>http://www.cgeek.org/?p=430#comments</comments>
		<pubDate>Sun, 28 Feb 2010 11:08:25 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=430</guid>
		<description><![CDATA[今天编译安装mysql的时候遇到error: No curses/termcap library found错误，网上说是ncurses没装，可rpm -qa &#124; grep ncurses发现已经安装了啊，原来是缺少ncurses-devel.其实常常遇到类似的问题，都是由于devel包没装~~
mark一下
]]></description>
			<content:encoded><![CDATA[<p>今天编译安装mysql的时候遇到error: No curses/termcap library found错误，网上说是ncurses没装，可rpm -qa | grep ncurses发现已经安装了啊，原来是缺少ncurses-devel.其实常常遇到类似的问题，都是由于devel包没装~~</p>
<p>mark一下</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=430</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于ldconfig及其使用</title>
		<link>http://www.cgeek.org/?p=428</link>
		<comments>http://www.cgeek.org/?p=428#comments</comments>
		<pubDate>Sat, 27 Feb 2010 04:02:49 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[Linux/c/c++]]></category>
		<category><![CDATA[ldconfig]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=428</guid>
		<description><![CDATA[今天试用了一下张宴大师的HTTPSQS【HTTPSQS（HTTP Simple Queue Service）是一款基于 HTTP GET/POST 协议的轻量级开源简单消息队列服务，使用 Tokyo Cabinet 的 B+Tree Key/Value 数据库来做数据的持久化存储。】
安装过程一切顺利，但使用中遇到一个错误：
[root@localhost httpsqs]#httpsqs -h
httpsqs: error while loading shared libraries: libtokyocabinet.so.9: cannot open shared object file: No such file or directory
提示找不到一个链接库（libtokyocabinet.so.9），find发现此文件位于/usr/local/lib目录，而系统搜索的是/usr/lib目录，可以简单的做一个软链接（ln -s）来解决问题，还有更好的解决方法是
将/usr/local/lib添加到/etc/ld.so.conf文件中，然后在命令行执行/sbin/ldconfig
man ldconfig查看ldconfig命令的描述，
     ldconfig creates the necessary links and cache to  the  most  recent  shared
   [...]]]></description>
			<content:encoded><![CDATA[<p>今天试用了一下张宴大师的HTTPSQS【HTTPSQS（HTTP Simple Queue Service）是一款基于 HTTP GET/POST 协议的轻量级开源简单消息队列服务，使用 Tokyo Cabinet 的 B+Tree Key/Value 数据库来做数据的持久化存储。】<br />
安装过程一切顺利，但使用中遇到一个错误：<br />
[root@localhost httpsqs]#httpsqs -h<br />
httpsqs: error while loading shared libraries: libtokyocabinet.so.9: cannot open shared object file: No such file or directory<br />
提示找不到一个链接库（libtokyocabinet.so.9），find发现此文件位于/usr/local/lib目录，而系统搜索的是/usr/lib目录，可以简单的做一个软链接（ln -s）来解决问题，还有更好的解决方法是<br />
将/usr/local/lib添加到/etc/ld.so.conf文件中，然后在命令行执行/sbin/ldconfig</p>
<p>man ldconfig查看ldconfig命令的描述，<br />
     ldconfig creates the necessary links and cache to  the  most  recent  shared<br />
       libraries  found  in  the  directories specified on the command line, in the<br />
       file /etc/ld.so.conf, and in the trusted directories  (/lib  and  /usr/lib).<br />
       The  cache  is  used by the run-time linker, ld.so or ld-linux.so.  ldconfig<br />
       checks the header and filenames of the libraries it encounters  when  deter-<br />
       mining which versions should have their links updated.<br />
你会发现他默认是在/lib and /usr/lib这两个目录下找的，而我们的libtokyocabinet.so.9是安装在/usr/local/lib下的。</p>
<p>罗嗦一句：Linux下的man是个好东西，熟悉了会比google解决问题的效率高~~~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=428</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash上传功能无法读取FireFox中的Session</title>
		<link>http://www.cgeek.org/?p=424</link>
		<comments>http://www.cgeek.org/?p=424#comments</comments>
		<pubDate>Tue, 23 Feb 2010 06:35:04 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=424</guid>
		<description><![CDATA[遇到一个奇怪的问题，头疼了很久，怀疑是firefox的bug或者根本就不支持&#8230;
用flash做一个上传图片的功能。系统用了Zend框架，默认的zend的auth，session认证。需要登入后才能上传。上传处理图片的函数用到了登入用户ID，保存图片到相应的用户id的目录下面。IE下都正常，但在火狐始终无法获取已经认证的用户ID，抓包返回用户ID为null。后来仔细抓包分析了IE下上传图片数据包的session和火狐下上传图片数据包的session。
IE下访问页面的session和上传图片数据包的session是一样的，而火狐下是不一样的。说明是火狐下flash上传读取不到session的原因吧。
应该是Flash上传功能无法读取FireFox中的Session。看来只能将用户id通过传递参数来实现了。
其他资料：
ActiveX模式下的Flash插件使用的是IE的链接池，所以获取的Session是一致的，而在Firefox下的是Plugin模式，使用自有的链接，没有使用FF的链接池，所以产生了两个不同的链接，所以Session找不到了，不过也不是没有解决办法，可以通过页面将 SessionID传给Flash，Flash在上传访问后台程序，如PHP时，将SessionID传给PHP，PHP可通过此SessionID找到相应的Session
相关链接：http://www.klstudio.com/post/186.html
]]></description>
			<content:encoded><![CDATA[<p>遇到一个奇怪的问题，头疼了很久，怀疑是firefox的bug或者根本就不支持&#8230;<br />
用flash做一个上传图片的功能。系统用了Zend框架，默认的zend的auth，session认证。需要登入后才能上传。上传处理图片的函数用到了登入用户ID，保存图片到相应的用户id的目录下面。IE下都正常，但在火狐始终无法获取已经认证的用户ID，抓包返回用户ID为null。后来仔细抓包分析了IE下上传图片数据包的session和火狐下上传图片数据包的session。<br />
IE下访问页面的session和上传图片数据包的session是一样的，而火狐下是不一样的。说明是火狐下flash上传读取不到session的原因吧。<br />
应该是Flash上传功能无法读取FireFox中的Session。看来只能将用户id通过传递参数来实现了。</p>
<p>其他资料：<br />
ActiveX模式下的Flash插件使用的是IE的链接池，所以获取的Session是一致的，而在Firefox下的是Plugin模式，使用自有的链接，没有使用FF的链接池，所以产生了两个不同的链接，所以Session找不到了，不过也不是没有解决办法，可以通过页面将 SessionID传给Flash，Flash在上传访问后台程序，如PHP时，将SessionID传给PHP，PHP可通过此SessionID找到相应的Session<br />
相关链接：<a href="http://www.klstudio.com/post/186.html">http://www.klstudio.com/post/186.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=424</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpize是什么？</title>
		<link>http://www.cgeek.org/?p=418</link>
		<comments>http://www.cgeek.org/?p=418#comments</comments>
		<pubDate>Sun, 22 Nov 2009 06:30:09 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[Linux/c/c++]]></category>
		<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpize]]></category>
		<category><![CDATA[扩展模块]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=418</guid>
		<description><![CDATA[今天在配置一台nginx的web服务器时，参考张宴(blog.s135.com)大师的《Nginx 0.8.x + PHP  5.2.10（FastCGI）搭建胜过Apache十倍的Web服务器（第5版）》
安装php（fastcgi模式）的时候，常常有这样一句命令：/usr/local/webserver/php/bin/phpize
一、phpize是干嘛的？
phpize是什么东西呢？php官方的说明：
http://php.net/manual/en/install.pecl.phpize.php
phpize是用来扩展php扩展模块的，通过phpize可以建立php的外挂模块
比如你想在原来编译好的php中加入memcached或者ImageMagick等扩展模块，可以使用phpize，通过以下几步工作。
二、如何使用phpize？
当php编译完成后，php的bin目录下会有phpize这个脚本文件。在编译你要添加的扩展模块之前，执行以下phpize就可以了；
比如现在想在php中加入memcache扩展模块：我们要做的只是如下几步
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
tar zxvf memcache-2.2.5.tgz
cd  memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure  &#8211;with-php-config=/usr/local/webserver/php/bin/php-config
make
make  install
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
注意./configure 后面可以指定的是php-config文件的路径
这样编译就完成了，还需要做的是在php.ini文件中加入extension值
extension = &#8220;memcache.so&#8221;
]]></description>
			<content:encoded><![CDATA[<p>今天在配置一台nginx的web服务器时，参考张宴(blog.s135.com)大师的<a href="nginx_php_v5/" target="_blank">《Nginx 0.8.x + PHP  5.2.10（FastCGI）搭建胜过Apache十倍的Web服务器（第5版）》</a><br />
安装php（fastcgi模式）的时候，常常有这样一句命令：/usr/local/webserver/php/bin/phpize</p>
<p>一、phpize是干嘛的？</p>
<p>phpize是什么东西呢？php官方的说明：<br />
<a href="http://php.net/manual/en/install.pecl.phpize.php">http://php.net/manual/en/install.pecl.phpize.php</a></p>
<p>phpize是用来扩展php扩展模块的，通过phpize可以建立php的外挂模块</p>
<p>比如你想在原来编译好的php中加入memcached或者ImageMagick等扩展模块，可以使用phpize，通过以下几步工作。</p>
<p>二、如何使用phpize？</p>
<p>当php编译完成后，php的bin目录下会有phpize这个脚本文件。在编译你要添加的扩展模块之前，执行以下phpize就可以了；</p>
<p>比如现在想在php中加入memcache扩展模块：我们要做的只是如下几步<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
tar zxvf memcache-2.2.5.tgz<br />
cd  memcache-2.2.5/<br />
/usr/local/webserver/php/bin/phpize<br />
./configure  &#8211;with-php-config=/usr/local/webserver/php/bin/php-config<br />
make<br />
make  install<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
注意./configure 后面可以指定的是php-config文件的路径</p>
<p>这样编译就完成了，还需要做的是在php.ini文件中加入extension值<br />
extension = &#8220;memcache.so&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=418</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>查漏补缺：FastCGI</title>
		<link>http://www.cgeek.org/?p=409</link>
		<comments>http://www.cgeek.org/?p=409#comments</comments>
		<pubDate>Sat, 21 Nov 2009 12:19:23 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=409</guid>
		<description><![CDATA[也许FastCGI早就不陌生，但是FastCGI到底是什么？我倒真没太理解，只知道用FastCGI就对了，快！
FastCGI的官网：http://www.fastcgi.com/
FastCGI is simple because it is actually CGI with only a few extensions. 很谦虚的说他只是CGI的一点点扩展而已;
一、FastCGI是什么？
FastCGI是语言无关的、可伸缩架构的CGI开放扩展，其主要 行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知，CGI解释器的反复加载是CGI性能低下的主要原因，如果CGI解释器保持在内存 中并接受FastCGI进程管理器调度，则可以提供良好的性能、伸缩性、Fail-Over特性等等。
FastCGI的工作原理是：
1、Web Server 启动时载入FastCGI进程管理器（IIS ISAPI或Apache Module）;
2、FastCGI进程管理器自身初始化，启动多个CGI解释器进程 (在任务管理器中可见多个php-cgi.exe)并等待来自Web Server的连接。
3、当客户端请求到达Web Server时，FastCGI进程管理器选择并连接到一个CGI解释器。Web server将CGI环境变量和标准输入发送到FastCGI子进程php-cgi.exe。
4、FastCGI子进程完成处理后将标准输出和错误信息从同一连接返回Web Server。当FastCGI子进程关闭连接时，请求便告处理完成。FastCGI子进程接着等待并处理来自FastCGI进程管理器（运行在 WebServer中）的下一个连接。 在正常的CGI模式中，php-cgi.exe在此便退出了。
在上述情况中，你可以想象 CGI通常有多慢。每一个Web请求PHP都必须重新解析php.ini、重新载入全部dll扩展并重初始化全部数据结构。使用FastCGI，所有这些 都只在进程启动时发生一次。一个额外的好处是，持续数据库连接(Persistent database connection)可以工作。
二、为什么要使用FastCGI，而不是多线程CGI解释器？
这可能出于多方面的考虑，例如：
1、你无论如何也不能在windows平台上稳定的使用多线程CGI解释器，无论是IIS ISAPI方式还是APACHE Module方式，它们总是运行一段时间就崩溃了。奇怪么？但是确实存在这样的情况！
当然，也有很多时候你能够稳定的使用多线程CGI解释器，但是，你有可能发现网页有时候会出现错误，无论如何也找不到原因，而换用FastCGI方式时 这种错误的概率会大大的降低。我也不清楚这是为什么，我想独立地址空间的CGI解释器可能终究比共享地址空间的形式来得稳定一点点。
2、性 能！性能？可能么，难道FastCGI比多线程CGI解释器更快？但有时候确实是这样，只有测试一下你的网站，才能最后下结论。原因嘛，我觉得很难讲，但 有资料说在Zend WinEnabler的时代，Zend原来也是建议在Windows平台下使用FastCGI而不是IIS ISAPI或Apache Module，不过现在Zend已经不做这个产品了。
三、不使用FastCGI的理由
1、多进程比多线程消耗更多的服务器内存，php-cgi.exe解释器每进程消耗7至25兆内存，将这个数字乘以50或100试试。
2、性能。确实有时候多线程CGI解释器更快，呵呵，而且有时候，它也很稳定。
3、CGI？听起来就很土，呵呵
http://blogme.cn/node/6529
其他资源：
扶凯：http://www.php-oa.com/2008/03/22/php-fastcgi.html
]]></description>
			<content:encoded><![CDATA[<p>也许FastCGI早就不陌生，但是FastCGI到底是什么？我倒真没太理解，只知道用FastCGI就对了，快！</p>
<p>FastCGI的官网：http://www.fastcgi.com/</p>
<p>FastCGI is simple because it is actually CGI with only a few extensions. 很谦虚的说他只是CGI的一点点扩展而已;<br />
<strong>一、FastCGI是什么？</strong></p>
<p>FastCGI是语言无关的、可伸缩架构的CGI开放扩展，其主要 行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知，CGI解释器的反复加载是CGI性能低下的主要原因，如果CGI解释器保持在内存 中并接受FastCGI进程管理器调度，则可以提供良好的性能、伸缩性、Fail-Over特性等等。</p>
<p>FastCGI的工作原理是：<br />
1、Web Server 启动时载入FastCGI进程管理器（IIS ISAPI或Apache Module）;<br />
2、FastCGI进程管理器自身初始化，启动多个CGI解释器进程 (在任务管理器中可见多个php-cgi.exe)并等待来自Web Server的连接。<br />
3、当客户端请求到达Web Server时，FastCGI进程管理器选择并连接到一个CGI解释器。Web server将CGI环境变量和标准输入发送到FastCGI子进程php-cgi.exe。<br />
4、FastCGI子进程完成处理后将标准输出和错误信息从同一连接返回Web Server。当FastCGI子进程关闭连接时，请求便告处理完成。FastCGI子进程接着等待并处理来自FastCGI进程管理器（运行在 WebServer中）的下一个连接。 在正常的CGI模式中，php-cgi.exe在此便退出了。<br />
在上述情况中，你可以想象 CGI通常有多慢。每一个Web请求PHP都必须重新解析php.ini、重新载入全部dll扩展并重初始化全部数据结构。使用FastCGI，所有这些 都只在进程启动时发生一次。一个额外的好处是，持续数据库连接(Persistent database connection)可以工作。<br />
<strong>二、为什么要使用FastCGI，而不是多线程CGI解释器？</strong><br />
这可能出于多方面的考虑，例如：<br />
1、你无论如何也不能在windows平台上稳定的使用多线程CGI解释器，无论是IIS ISAPI方式还是APACHE Module方式，它们总是运行一段时间就崩溃了。奇怪么？但是确实存在这样的情况！<br />
当然，也有很多时候你能够稳定的使用多线程CGI解释器，但是，你有可能发现网页有时候会出现错误，无论如何也找不到原因，而换用FastCGI方式时 这种错误的概率会大大的降低。我也不清楚这是为什么，我想独立地址空间的CGI解释器可能终究比共享地址空间的形式来得稳定一点点。<br />
2、性 能！性能？可能么，难道FastCGI比多线程CGI解释器更快？但有时候确实是这样，只有测试一下你的网站，才能最后下结论。原因嘛，我觉得很难讲，但 有资料说在Zend WinEnabler的时代，Zend原来也是建议在Windows平台下使用FastCGI而不是IIS ISAPI或Apache Module，不过现在Zend已经不做这个产品了。<br />
<strong>三、不使用FastCGI的理由</strong><br />
1、多进程比多线程消耗更多的服务器内存，php-cgi.exe解释器每进程消耗7至25兆内存，将这个数字乘以50或100试试。<br />
2、性能。确实有时候多线程CGI解释器更快，呵呵，而且有时候，它也很稳定。<br />
3、CGI？听起来就很土，呵呵<br />
http://blogme.cn/node/6529<br />
其他资源：<br />
扶凯：http://www.php-oa.com/2008/03/22/php-fastcgi.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=409</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>谈web2.0下的网络营销&#8211;Geekcook篇</title>
		<link>http://www.cgeek.org/?p=401</link>
		<comments>http://www.cgeek.org/?p=401#comments</comments>
		<pubDate>Wed, 04 Nov 2009 07:18:32 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[MyLife]]></category>
		<category><![CDATA[WEB 2.0 research]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[网络营销]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=401</guid>
		<description><![CDATA[Geekcook.com一个非常有创意的Tee网店。与其说网店，它更像是一个表达对互联网热爱的的方式。最早是从Twitter上看到了，看到推友 从@geekcooktweet买了件Tee。当时是感@geekcooktweet这个网名和自己的网名好像，点进去一看，就感觉到了他的独特性。立即买了件twitter tee 。当时Geekcook.com是用一个wordpress程序搭的小站，里面简单的展示了他有点商品。商品都非常个性化，很IT ！！！
show一下我买的twitter Tee ：
让我思考更多的是他的这种模式。单独的blog程序，摆脱了淘宝网的框框架架，第一眼给人以独特的感觉。而独立网店有更强的可制定性。更重要的是，他能结合更多的web 2.0工具进行网络营销。  Rss、Twitter、Tag。推广的时候以独立域名，独立页面的形式，这种对于追求个性、喜欢互联网的人来说是非常有吸引力的，特别是Geekcook.com销售的商品又是以 互联网 为主题的Tee 。
适合的商品（Tee）+适合的目标人群（IT人）+适合的营销手段（sns、twitter、blog） = 成功的营销（网络营销）
twitter为代表的围脖改变了信息传播的方式，使信息的传播更迅速，这给网络营销带来了新的思考。如何利用这些web 2.0工具，推销我们的产品？ 个人觉得最重要的是口碑。第二:形象。
记得前段时间，有推友在twitter上说网警又要请他去喝茶@geekcooktweet说，去吧，我可以赞助Twitter Tee！！ 这些细节其实就是网络营销的细节。在潜移默化中在树立自己的形象。
至于现在为什么Geekcook.com把原来的blog程序给去掉了？我还不明白。个人觉得还是有一个独立的展示平台比较好。想HelloTee做得也挺好的。
最近Geekcook.com推出的“写博客免运费”的活动我觉得也是网络营销非常成功的方法。我发现HelloTee也采用了这种方法。其实web 2.0最核心应该是blog 。正是因为博客，才是使现在的网络如此精彩。而bloger在互联网里的作用是非常重要的，如何调动这部分人的力量的实现 &#8220;网络营销&#8221;的重要因素。写博客，免运费，很好的刺激了部分bloger，为自己做推广。
而Geekcook.com、还有helloTee这类模式，同样应该给电子商务带来更多的思考。如何更好的将 电子商务 结合 web 2.0工具进行网络营销 ？ 也许你也可以创出更好的模式~~~
其他资料：
那么什么是web 2.0 ？
上面的图主要涵盖了web 2.0的技术。我们引用网上对web 2.0比较普遍的一种解释：Web2.0是以 Flickr、Craigslist、Linkedin、Tribes、Ryze、 Friendster、Del.icio.us、43Things.com等网站为代表，以Blog、TAG、SNS、RSS、wiki等应用为核心，依据六度分隔、xml、ajax等新理论和技术实现的互联网新一代模式。
在我看来
]]></description>
			<content:encoded><![CDATA[<p><a title="geekcook.com" href="http://geekcook.taobao.com" target="_blank">Geekcook.com</a>一个非常有创意的Tee网店。与其说网店，它更像是一个表达对互联网热爱的的方式。最早是从Twitter上看到了，看到推友 从<span style="font-size: x-small; font-family: 宋体;"><a href="http://twitter.com/geekcooktweet">@geekcooktweet</a></span>买了件Tee。当时是感<a href="http://twitter.com/geekcooktweet"><span style="font-size: x-small; font-family: 宋体;">@geekcooktweet</span></a>这个网名和自己的网名好像，点进去一看，就感觉到了他的独特性。立即买了件twitter tee 。当时<a title="geekcook.com" href="http://geekcook.taobao.com" target="_blank">Geekcook.com</a>是用一个wordpress程序搭的小站，里面简单的展示了他有点商品。商品都非常个性化，很IT ！！！</p>
<p>show一下我买的twitter Tee ：<img class="alignnone" title="twitter tee" src="http://img03.taobaocdn.com/bao/uploaded/i3/T1RSBfXdBFXXa5g8ZU_015625.jpg_310x310.jpg" alt="" width="310" height="310" /></p>
<p>让我思考更多的是他的这种模式。单独的blog程序，摆脱了淘宝网的框框架架，第一眼给人以独特的感觉。而独立网店有更强的可制定性。更重要的是，他能结合更多的web 2.0工具进行网络营销。  Rss、Twitter、Tag。推广的时候以独立域名，独立页面的形式，这种对于追求个性、喜欢互联网的人来说是非常有吸引力的，特别是<a title="geekcook.com" href="http://geekcook.taobao.com" target="_blank">Geekcook.com</a>销售的商品又是以 互联网 为主题的Tee 。</p>
<p>适合的商品（Tee）+适合的目标人群（IT人）+适合的营销手段（sns、twitter、blog） = 成功的营销（网络营销）</p>
<p>twitter为代表的围脖改变了信息传播的方式，使信息的传播更迅速，这给网络营销带来了新的思考。如何利用这些web 2.0工具，推销我们的产品？ 个人觉得最重要的是口碑。第二:形象。</p>
<p>记得前段时间，有推友在twitter上说网警又要请他去喝茶<a href="http://twitter.com/geekcooktweet"><span style="font-size: x-small; font-family: 宋体;">@geekcooktweet</span></a>说，去吧，我可以赞助Twitter Tee！！ 这些细节其实就是网络营销的细节。在潜移默化中在树立自己的形象。</p>
<p>至于现在为什么Geekcook.com把原来的blog程序给去掉了？我还不明白。个人觉得还是有一个独立的展示平台比较好。想HelloTee做得也挺好的。</p>
<p>最近<a title="geekcook.com" href="http://geekcook.taobao.com" target="_blank">Geekcook.com</a>推出的“<a href="http://item.taobao.com/auction/item_detail-db1-1112e4e2e754eb2f445e9a7ae30d15e9.htm" target="_blank"><span style="font-size: 10pt; color: #3366cc; background-color: #e6e6e6;">写博客免运费</span></a>”的活动我觉得也是网络营销非常成功的方法。我发现<a href="http://www.hellotee.com">HelloTee</a>也采用了这种方法。其实web 2.0最核心应该是blog 。正是因为博客，才是使现在的网络如此精彩。而bloger在互联网里的作用是非常重要的，如何调动这部分人的力量的实现 &#8220;网络营销&#8221;的重要因素。写博客，免运费，很好的刺激了部分bloger，为自己做推广。</p>
<p>而<a title="geekcook.com" href="http://geekcook.taobao.com" target="_blank">Geekcook.com</a>、还有helloTee这类模式，同样应该给电子商务带来更多的思考。如何更好的将 电子商务 结合 web 2.0工具进行网络营销 ？ 也许你也可以创出更好的模式~~~<br />
其他资料：</p>
<p>那么什么是web 2.0 ？<img class="alignnone" title="web 2.0" src="http://p.blog.csdn.net/images/p_blog_csdn_net/dragony2k_lg/web2.0.gif" alt="" width="450" height="360" /></p>
<p>上面的图主要涵盖了web 2.0的技术。我们引用网上对web 2.0比较普遍的一种解释：Web2.0是以 Flickr、Craigslist、Linkedin、Tribes、Ryze、 Friendster、Del.icio.us、43Things.com等网站为代表，以Blog、TAG、SNS、RSS、wiki等应用为核心，依据六度分隔、xml、ajax等新理论和技术实现的互联网新一代模式。</p>
<p>在我看来</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=401</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>不是iconv函数的bug</title>
		<link>http://www.cgeek.org/?p=391</link>
		<comments>http://www.cgeek.org/?p=391#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:22:04 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=391</guid>
		<description><![CDATA[上一篇把题目写成《iconv函数的小bug》怪吓人的~~~华晨同学的回复使我感到自己的不求甚解.正所谓知错能改，善莫大焉。于是我重新查了一遍：php官方的说明：http://cn.php.net/manual/en/function.iconv.php
函数原型：string iconv ( string $in_charset , string $out_charset , string $str )
特别是第二个参数说明：
The output charset. 
If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can&#8217;t be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, [...]]]></description>
			<content:encoded><![CDATA[<p class="postContent">上一篇把题目写成《iconv函数的小bug》怪吓人的~~~<a href="http://blog.huachen.me/"><span style="color: #727248;">华晨</span></a>同学的回复使我感到自己的不求甚解.正所谓知错能改，善莫大焉。于是我重新查了一遍：php官方的说明：<a href="http://cn.php.net/manual/en/function.iconv.php"><span style="color: #727248;">http://cn.php.net/manual/en/function.iconv.php</span></a><br />
<span class="type">函数原型：string</span> <span class="methodname"><strong>iconv</strong></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$in_charset</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$out_charset</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$str</tt></span> )<br />
特别是第二个参数说明：<br />
The output charset. </p>
<p>If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can&#8217;t be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character and an E_NOTICE is generated. </p>
<p class="para">意思是如果你在第二个参数后面加上//TRANSLIT ，这样的话，当遇到目标输出的编码不认识的字符的时候，能被一个或几个近似的字符代替；而如果在第二个参数后面加上//IGNORE的时候，当目标输出的编码不认识的时候则什么也不操作；什么都不加的时候则会报错~~~</p>
<p class="para">手册里面有个非常生动的例子：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is the Euro symbol '€'.&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'Original : '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> PHP_EOL<span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'TRANSLIT : '</span><span style="color: #339933;">,</span> <span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ISO-8859-1//TRANSLIT&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> PHP_EOL<span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'IGNORE   : '</span><span style="color: #339933;">,</span> <span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ISO-8859-1//IGNORE&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> PHP_EOL<span style="color: #339933;">;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">'Plain    : '</span><span style="color: #339933;">,</span> <span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ISO-8859-1&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> PHP_EOL<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p class="phpcode"><code><span style="color: #000000;">输出结果是：</span></code></p>
<p class="phpcode">Original : This is the Euro symbol &#8216;€&#8217;.<br />
TRANSLIT : This is the Euro symbol &#8216;EUR&#8217;.<br />
IGNORE   : This is the Euro symbol &#8221;.<br />
Plain    :<br />
Notice: iconv(): Detected an illegal character in input string in .\iconv-example.php on line 7<br />
This is the Euro symbol &#8216;</p>
<p>这样就非常清楚了</p>
<p>这里总结几点教训：</p>
<p>第一：php最好的手册就是官方的在线收藏;</p>
<p>(网上下的php中文手册往往会不完整或者没有更新，开始就是因为我电脑上的php中文手册没有这几个参数的说明)</p>
<p>第二：别太相信百度、google的中文搜索结果，别人讲的不一定是对的~~</p>
<p>最好就是直接找最权威，最官方的说明~~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=391</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iconv函数的一个小bug</title>
		<link>http://www.cgeek.org/?p=386</link>
		<comments>http://www.cgeek.org/?p=386#comments</comments>
		<pubDate>Sun, 20 Sep 2009 09:21:37 +0000</pubDate>
		<dc:creator>cgeek</dc:creator>
				<category><![CDATA[PHP/ web]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.cgeek.org/?p=386</guid>
		<description><![CDATA[昨天在做ajax调用的时候，发现调用出来的文章内容有的缺少一些内容，搞了半天，原来是iconv函数在作怪~~~
网上说这是php的iconv函数的一个小bug：
原来 iconv( &#8220;UTF-8&#8243;, &#8220;gb2312&#8243; , $string)  应该在第二个参数后面加个参数：
iconv( &#8220;UTF-8&#8243;, &#8220;gb2312//IGNORE&#8221; ,  $string)
ignore的意思是忽略转换时的错误，发现iconv在转换字符&#8221;—&#8221;到gb2312时会出错，如果没有ignore参数，所有该字符后面的字符串都无法被保存。
在此记录一下~~~
]]></description>
			<content:encoded><![CDATA[<p>昨天在做ajax调用的时候，发现调用出来的文章内容有的缺少一些内容，搞了半天，原来是iconv函数在作怪~~~<br />
网上说这是php的iconv函数的一个小bug：<br />
原来 iconv( &#8220;UTF-8&#8243;, &#8220;gb2312&#8243; , $string)  应该在第二个参数后面加个参数：<br />
iconv( &#8220;UTF-8&#8243;, &#8220;gb2312//IGNORE&#8221; ,  $string)</p>
<p>ignore的意思是忽略转换时的错误，发现iconv在转换字符&#8221;—&#8221;到gb2312时会出错，如果没有ignore参数，所有该字符后面的字符串都无法被保存。</p>
<p>在此记录一下~~~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cgeek.org/?feed=rss2&amp;p=386</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
