<?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>gkp&#039;s post &#187; php</title>
	<atom:link href="http://b.gkp.cc/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://b.gkp.cc</link>
	<description>Just another gkp&#039;s family blogs site</description>
	<lastBuildDate>Sun, 11 Sep 2011 01:15:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Live Writer 发布到 WordPress HTML 标记丢失的问题根源与解决</title>
		<link>http://b.gkp.cc/2010/12/25/live-writer-publish-to-wordpress-html-tag-missing/</link>
		<comments>http://b.gkp.cc/2010/12/25/live-writer-publish-to-wordpress-html-tag-missing/#comments</comments>
		<pubDate>Sat, 25 Dec 2010 15:46:33 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[guao]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/2010/12/25/live-writer-publish-to-wordpress-html-tag-missing/</guid>
		<description><![CDATA[今天在搞 guaobackup 时遇到了一个非常奇怪的问题：通过 Windows Live Writer 发布的帖子中 html 标记的 &#60;&#62; 都被自动过滤掉了，要说 wordpress 自己也搞过很多个了，但是这样的问题还真是第一次遇到，而且仔细查看 wordpress 和 wlw 的设置后也没有发现类似的设置可以修改。 貌似我 blog 的帖子都是 google 找到答案。。。难道还能是百毒吗？原来这是 lib-xml2 2.6.30 到 2.7.3 之间的版本存在 bug，这篇文章很详细的讲述了这个 bug 的起因。解决办法： 修改 wp 源程序，刚才那篇文章中有办法，不推荐，以后升级很麻烦。 重新编译 php，用 expat 这个 xml 解析器替代 libxml2。 &#8230; <a href="http://b.gkp.cc/2010/12/25/live-writer-publish-to-wordpress-html-tag-missing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://b.gkp.cc/files/2010/12/wp_html_missing.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="wp_html_missing" border="0" alt="wp_html_missing" src="http://b.gkp.cc/files/2010/12/wp_html_missing_thumb.png" width="666" height="359"></a> </p>
<p>今天在搞 <a href="http://www.guaobackup.com" target="_blank">guaobackup</a> 时遇到了一个非常奇怪的问题：通过 Windows Live Writer 发布的帖子中 html 标记的 &lt;&gt; 都被自动过滤掉了，要说 wordpress 自己也搞过很多个了，但是这样的问题还真是第一次遇到，而且仔细查看 wordpress 和 wlw 的设置后也没有发现类似的设置可以修改。</p>
<p>貌似我 blog 的帖子都是 google 找到答案。。。难道还能是百毒吗？原来这是 lib-xml2 2.6.30 到 2.7.3 之间的版本存在 bug，<a href="http://techtites.com/2009/01/14/fix-the-windows-live-writer-and-wordpress-stripping-tags-issue/" target="_blank">这篇文章</a>很详细的讲述了这个 bug 的起因。解决办法：</p>
<ol>
<li>修改 wp 源程序，刚才<a href="http://techtites.com/2009/01/14/fix-the-windows-live-writer-and-wordpress-stripping-tags-issue/" target="_blank">那篇文章</a>中有办法，不推荐，以后升级很麻烦。</li>
<li>重新编译 php，用 expat 这个 xml 解析器替代 libxml2。</li>
<li>用<a href="http://wordpress.org/extend/plugins/libxml2-fix/" target="_blank">这个 wp 插件</a>凑合一下。</li>
<li>也就是最彻底的解决办法：把 PHP 升级到 5.2.9 以上，libxml2 升级到 2.7.3 以上的版本。</li>
</ol>
<p>虽然我用的是 php 5.3.3，但是在 phpinfo 中看到 dotdeb 这个 package 居然是用 libxml2 2.6 编译而来的，难怪存在这个问题。顺手把服务器做了个系统升级到 Ubuntu 10.10，php 和 nginx 也都用官方源和 ppa 升级到最新版，问题解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/12/25/live-writer-publish-to-wordpress-html-tag-missing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ubuntu server 10.10 安装配置 nginx + php-fpm + mysql</title>
		<link>http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/</link>
		<comments>http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 17:53:09 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/</guid>
		<description><![CDATA[安装好 ubuntu server 10.10 并升级软件包后，接下来安装 nginx + php-fpm + mysql，10.10 中的 php 已经是自带 php-fpm 的 5.3.3，所以 php-fpm 理所当然成为 fastcgi 的首选。 安装 mysql： sudo aptitude install mysql-server 使用官方 ppa 安装 nginx： sudo aptitude install python-software-propertiessudo add-apt-repository ppa:nginx/stablesudo aptitude updatesudo aptitude install &#8230; <a href="http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://b.gkp.cc/2010/10/12/install-ubuntu-1010-maverick-with-flash-disk/" target="_blank">安装好</a> ubuntu server 10.10 并升级软件包后，接下来安装 nginx + php-fpm + mysql，10.10 中的 php 已经是自带 php-fpm 的 5.3.3，所以 php-fpm 理所当然成为 fastcgi 的首选。
<p>安装 mysql：<br />
<blockquote>
<p>sudo aptitude install mysql-server</p>
</blockquote>
<p>使用官方 ppa 安装 nginx：</p>
<blockquote><p>sudo aptitude install python-software-properties<br />sudo add-apt-repository ppa:nginx/stable<br />sudo aptitude update<br />sudo aptitude install nginx</p>
</blockquote>
<p>安装 phpy + php-fpm + 其他模块：<br />
<blockquote>
<p>sudo aptitude install php5-cgi php5-mysql php5-fpm php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl</p>
</blockquote>
<p>配置 php：<br />
<blockquote>
<p>sudo vi /etc/php5/fpm/php.ini </p>
</blockquote>
<p>设置<br />
<blockquote>
<p>cgi.fix_pathinfo=0</p>
</blockquote>
<p>原因<a href="http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/" target="_blank">见这里</a>。接下来修改 nginx 虚拟主机设置：<br />
<blockquote>
<p>sudo rm -r /etc/nginx/sites-available<br />sudo rm /etc/nginx/sites/default<br />sudo vi /etc/nginx/sites/default</p>
</blockquote>
<p>内容，我这里 IPv4 和 IPv6 用了两条独立的命令监听，原因<a href="http://b.gkp.cc/2010/10/01/ipv6-nginx-on-linux-remoteaddr-issue/" target="_blank">见这里</a>。</p>
<p><span id="more-1711"></span><br />
<blockquote>
<p>server {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp; [::]:80;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp; 80;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name&nbsp; xxx.xxxxx.xxx;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp; /var/www/;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #access_log&nbsp; /var/www/log/xxx-access.log;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #error_log&nbsp;&nbsp; /var/www/logs/xxx-error.log;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location / {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index&nbsp; index.php index.html index.htm;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #error_page&nbsp; 404&nbsp; /404.html;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # redirect server error pages to the static page /50x.html<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #error_page&nbsp;&nbsp; 500 502 503 504&nbsp; /50x.html;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #location = /50x.html {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root&nbsp;&nbsp; /var/www/nginx-default;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #}
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location ~ \.php$ {
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_pass&nbsp;&nbsp; 127.0.0.1:9000;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_index&nbsp; index.php;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_params;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location ~ /\.ht {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deny&nbsp; all;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />}</p>
</blockquote>
<p>修改 fastcgi 参数，<br />
<blockquote>
<p>sudo vi /etc/nginx/fastcgi_params</p>
</blockquote>
<p>加入：<br />
<blockquote>
<p>fastcgi_param&nbsp; SCRIPT_FILENAME&nbsp;&nbsp;&nbsp; $document_root$fastcgi_script_name;<br />fastcgi_param&nbsp; PATH_INFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $fastcgi_script_name;<br />fastcgi_connect_timeout 60;<br />fastcgi_send_timeout 180;<br />fastcgi_read_timeout 180;<br />fastcgi_buffer_size 128k;<br />fastcgi_buffers 4 256k;<br />fastcgi_busy_buffers_size 256k;<br />fastcgi_temp_file_write_size 256k;<br />fastcgi_intercept_errors on;</p>
</blockquote>
<p>重新启动 nginx 和 php-fpm，配置完成：<br />
<blockquote>
<p>sudo /etc/init.d/nginx restart<br />sudo /etc/init.d/php5-fpm reload</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Discuz 在 nginx+fastcgi 环境下相对路径问题的解决</title>
		<link>http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/</link>
		<comments>http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 16:20:58 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的慵懒生活]]></category>
		<category><![CDATA[discuz]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/</guid>
		<description><![CDATA[这几天在陆续用 apache 替换成 nginx，发现所有在用的 discuz 都出现了 php 脚本中相对路径的问题。比如 discuz 动态头像调用是类似于： http://www.xxx.com/ucenter/avatar.php?uid=21480&#38;size=middle 但是调用后的地址就变成了： http://www.xxx.com/ucenter/avatar.php/ucenter/data/images/000/05/60/39_avatar_middle.jpg 查看源代码发现，discuz 中的相对路径都是直接写的文件名，前面没有 ./，与此同时还带来了批量上传 flash 文件无法调用 misc.php 导致提示文字无法显示，引用及提醒信息跳转地址错误等，一概都是由于指向了错误的 xxx.php/dir 这样的 url。感觉不应该是 nginx 的问题，于是查看 php.ini 相关设置，发现 cgi.fix_pathinfo 这个选项正是解决问题的关键，将这个值设置为 0 的话，PATH_TRANSLATED 将等同于 SCRIPT_FILENAME，之后重启 php-fpm 后 discuz 的这个问题就解决了。看来还是 discuz 7.2 代码兼容性的问题，不知道更新的 &#8230; <a href="http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>这几天在陆续用 apache 替换成 nginx，发现所有在用的 discuz 都出现了 php 脚本中相对路径的问题。比如 discuz 动态头像调用是类似于：</p>
<blockquote><p><a href="http://www.xxx.com/ucenter/avatar.php?uid=21480&amp;size=middle">http://www.xxx.com/ucenter/avatar.php?uid=21480&amp;size=middle</a></p>
</blockquote>
<p>但是调用后的地址就变成了：</p>
<blockquote><p><a href="http://www.xxx.com/ucenter/avatar.php/ucenter/data/images/000/05/60/39_avatar_middle.jpg">http://www.xxx.com/ucenter/avatar.php/ucenter/data/images/000/05/60/39_avatar_middle.jpg</a></p>
</blockquote>
<p>查看源代码发现，discuz 中的相对路径都是直接写的文件名，前面没有 ./，与此同时还带来了批量上传 <a href="http://android.google.org.cn/tag/flash" target="_blank">flash</a> 文件无法调用 misc.php 导致提示文字无法显示，引用及提醒信息跳转地址错误等，一概都是由于指向了错误的 xxx.php/dir 这样的 url。感觉不应该是 nginx 的问题，于是查看 php.ini 相关设置，发现 <a href="http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo" target="_blank">cgi.fix_pathinfo</a> 这个选项正是解决问题的关键，将这个值设置为 0 的话，PATH_TRANSLATED 将等同于 SCRIPT_FILENAME，之后重启 php-fpm 后 discuz 的这个问题就解决了。看来还是 discuz 7.2 代码兼容性的问题，不知道更新的 dzx 是否已经有所改进了？</p>
<p>UPDATE：发现今年5月有一个<a href="http://www.80sec.com/nginx-securit.html" target="_blank">相关的 nginx 漏洞</a>，可以参考。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/09/28/php-relative-path-problem-of-discuz-running-on-nginx-fastcgi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debian Lenny 安装 Nginx + PHP5 FastCGI 笔记</title>
		<link>http://b.gkp.cc/2010/09/08/setup-nginx-php5-fastcgi-on-debian-lenny/</link>
		<comments>http://b.gkp.cc/2010/09/08/setup-nginx-php5-fastcgi-on-debian-lenny/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 08:45:11 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[guao]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/?p=1634</guid>
		<description><![CDATA[PS：这篇 blog 是我第一次尝试安装 nginx 时候写的，有不少配置不合理的地方，更好的配置请参考这篇文章。 由于最近谷奥的负载实在比较大，究其根本除去 WordPress 本身程序的问题外，很大一部分原因在于 Apache 的低效。虽然谷奥更换了更强劲的 Xeon x3370 CPU，但是还是未雨绸缪试了试传说中可以承受 Apache 10 倍负载的 Nginx，安装环境为 运行 Debian Lenny 的 VPS。 1，安装 Nginx： aptitude install nginx 搞定了。。。打开 80 端口看一下吧，应该已经 Welcome to nginx 了。 2，安装 php5： aptitude install php5-cgi php5-mysql &#8230; <a href="http://b.gkp.cc/2010/09/08/setup-nginx-php5-fastcgi-on-debian-lenny/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="nginx_shirt" src="http://b.gkp.cc/files/2010/09/nginx_shirt.jpg" border="0" alt="nginx_shirt" width="402" height="330" /></p>
<p>PS：这篇 blog 是我第一次尝试安装 nginx 时候写的，有不少配置不合理的地方，更好的配置请参考<a href="http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/" target="_blank">这篇文章</a>。</p>
<p>由于最近<a href="http://www.google.org.cn" target="_blank">谷奥</a>的负载实在比较大，究其根本除去 <a href="http://wordpress.org" target="_blank">WordPress</a> 本身程序的问题外，很大一部分原因在于 Apache 的低效。虽然谷奥更换了更强劲的 <a href="http://ark.intel.com/Product.aspx?id=35433" target="_blank">Xeon x3370 CPU</a>，但是还是未雨绸缪试了试传说中可以承受 Apache 10 倍负载的 <a href="http://nginx.org/" target="_blank">Nginx</a>，安装环境为 运行 Debian Lenny 的 VPS。</p>
<p>1，安装 Nginx：</p>
<pre>aptitude install nginx</pre>
<p>搞定了。。。打开 80 端口看一下吧，应该已经 Welcome to nginx 了。</p>
<p>2，安装 php5：</p>
<pre>aptitude install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl</pre>
<p>如果你还需要什么变态模块的话尽管往上加好了</p>
<p>修改 php.ini</p>
<pre>vi /etc/php5/cgi/php.ini</pre>
<p>在最后加入一行</p>
<pre>cgi.fix_pathinfo = 1</pre>
<p>接下来要让 php-cgi 以一个 daemon 形式运行，基本有以下几个方法：</p>
<ul>
<li>php-cgi 本身使用 <a href="http://davidwinter.me.uk/articles/2009/06/13/php-and-nginx-the-easy-way/" target="_blank">-b 参数</a></li>
<li>lighthttpd 自带的 spawn-fcgi</li>
<li><a href="http://www.google.org.cn/tag/python" target="_blank">Python</a> 脚本 <a href="http://supervisord.org/" target="_blank">supervisord</a></li>
<li><a href="http://php-fpm.org/" target="_blank">PHP-FPM</a>（Fast Process Manager），很多高负载服务器上使用的是这个，即将进入 PHP 的 Trunk。</li>
</ul>
<p><a href="http://php-fpm.org/about/" target="_blank">这里</a>有 php-cgi, spawn-fcgi 和 PHP-FPM 的一些细节比较。</p>
<p>这里我们使用 spawn-fcgi。</p>
<p>借用 lighthttpd：</p>
<pre>aptitude install lighttpd</pre>
<p>安装的最后启动 lighthttpd 的时候会提示你启动失败，80 端口已经被占用，这是正常的，因为 nginx 正在那里跑着，所以不用管它。安装完成后将 lighthttpd 从 rc 里面删除</p>
<pre>update-rc.d -f lighttpd remove</pre>
<p>我们可以用如下命令启动 spawn-fcgi</p>
<pre>/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid</pre>
<p>可以将其加入 rc.local，以后每次开机自动启动</p>
<p>编辑一下 nginx 默认虚拟主机的配置文件，加入 php 支持</p>
<pre>vi /etc/nginx/sites-available/default</pre>
<p>修改成</p>
<pre># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  /var/www/nginx-default$fastcgi_script_name;
include        fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny  all;
}
}</pre>
<p>重新启动 ngingx</p>
<pre>/etc/init.d/nginx restart</pre>
<p>写个 phpinfo() 放到  /var/www/nginx-default/ 里面看看吧，应该已经可以显示了。</p>
<p>参考：</p>
<ul>
<li><a href="http://www.howtoforge.com/installing-nginx-with-php5-and-mysql-support-on-debian-lenny" target="_blank">Installing Nginx With PHP5 And MySQL Support On Debian Lenny</a></li>
<li><a href="http://www.fredshack.com/docs/nginx.html" target="_blank">Quick Guide to Nginx</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/09/08/setup-nginx-php5-fastcgi-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>简述 GFWInterceptor PHP 服务器端安装</title>
		<link>http://b.gkp.cc/2010/08/17/setup-php-proxy-server-for-gfwinterceptor/</link>
		<comments>http://b.gkp.cc/2010/08/17/setup-php-proxy-server-for-gfwinterceptor/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 17:59:45 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的慵懒生活]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[GFW]]></category>
		<category><![CDATA[GFWInterceptor]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/?p=1457</guid>
		<description><![CDATA[18911080868 佟 <a href="http://b.gkp.cc/2010/08/17/setup-php-proxy-server-for-gfwinterceptor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="g_f_w" src="http://b.gkp.cc/files/2010/08/g_f_w.png" border="0" alt="g_f_w" width="345" height="151" /></p>
<p><strong><em>2010/12/14 更新，适用于 </em></strong><a href="http://code.google.com/p/gfwinterceptor/downloads/detail?name=api-proxy-php-0.5.zip" target="_blank"><strong><em>api-proxy-php-0.5.zip</em></strong></a><strong><em>，步骤简化了很多，推荐使用</em></strong></p>
<h2>0，服务器环境要求</h2>
<p>服务器最好运行 Linux / FreeBSD 等操作系统，需要使用 apache httpd（nginx 有专用版本，请直接往下看），并且启用了 mod_rewrite，PHP 启用了 cURL支持。</p>
<h2>1，下载/解压缩源代码</h2>
<p>下载源代码压缩包：<a title="http://gfwinterceptor.googlecode.com/files/api-proxy-php-0.5.zip" href="http://gfwinterceptor.googlecode.com/files/api-proxy-php-0.5.zip">http://gfwinterceptor.googlecode.com/files/api-proxy-php-0.5.zip</a>，解压后将 api-proxy-php 目录中的所有文件上传 / 移动到服务器相应目录。</p>
<h2>2，文件配置</h2>
<p>将 ~htaccess 文件改名为 .htaccess，之后用编辑器打开 users.config，按照文件中示范的每行一个用户名密码，用分号分隔的格式填入允许访问服务器的用户名密码。</p>
<p>不过需要注意的是，在默认 mime 情况下，apache 会把 users.config 当作文本文件，也就是说别人在浏览器输入 your.server/users.config 可以直接看到你的用户密码配置文件！临时解决办法是修改 index.php 第六行</p>
<blockquote><p>$file_handle = fopen("users.config", "rb");</p></blockquote>
<p>中的 users.config 位置，最好放到 http root 以外，比如改成 /home/gkp/gfw/users.config，之后把 users.config 移动到相应的位置就可以了。</p>
<h2>3，开始使用吧</h2>
<p>在<a href="http://b.gkp.cc/2010/08/16/gfwinterceptor-is-another-gfw-fucker/">安装好 GFWInterceptor</a> 的 iDevice 上进入 Settings –&gt; GFWInterceptor，将主力服务器设置成你安装 PHP 服务器端文件的地址，注意开头的 http:// 不要省略。在相应的位置填入上一步 users.config 中设定的用户名和密码，之后 respring 一下，打开 twitter for iPhone, Facebook, Foursquare 等应用试试看吧，没有问题的话应该可以顺利登录了。之后打开 safari，试试看 m.twitter.com，应该也是可以访问的。</p>
<h2>4，有问题？</h2>
<p>当安装 php-server 出现问题时，首先查看下 apache 的日志文件，如果都是类似于 File does not exist: /var/www/html/1 这样的报错的话，应该是 url rewrite 没有正常工作，请检查 apache 的 mod_rewrite 和 php-server 目录下面的 .htaccess 文件。</p>
<h2>5，适用于 nginx 的版本</h2>
<p>适用于 nginx 的 php 服务端程序目前还不支持用户名密码验证，安装方法如下：</p>
<ul>
<li>下载 <a title="http://gfwinterceptor.googlecode.com/files/api-proxy-php-ngix-0.4.zip" href="http://gfwinterceptor.googlecode.com/files/api-proxy-php-ngix-0.4.zip">http://gfwinterceptor.googlecode.com/files/api-proxy-php-ngix-0.4.zip</a>，并解压缩</li>
<li>把 api-proxy-php-ngix 目录下的文件上传/移动到服务器相应目录</li>
<li>把 gic 这个虚拟主机配置文件放到 nginx 会自动 include 的目录中，并编辑之，根据实际情况修改域名，文档目录等选项，最后重启 nginx。</li>
<li>搞定！</li>
</ul>
<p><em>以下为老版本 php server 安装步骤，已经失效，仅供参考。</em></p>
<p><span id="more-1457"></span></p>
<p>首先非常感谢 <a href="http://twitter.com/overboming " target="_blank">@overboming</a> 同学连续两个晚上和我调试 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 的 PHP 服务端，而且今天后来很长一段时间都是因为我的一个操作失误导致的错误，实在是很对不住 <a href="http://twitter.com/overboming " target="_blank">@overboming</a> 同学，具体的这个操作失误在最后会提到，先来简单说一下安装的过程。</p>
<h2>1，下载源代码</h2>
<p>有两种方式，使用 svn：</p>
<pre>svn checkout https://gfwinterceptor.googlecode.com/svn/trunk/api-proxy-php</pre>
<p>或者直接到下面这个地址下载 index.php 和 .htaccess 这两个文件的 raw file</p>
<p><a title="http://code.google.com/p/gfwinterceptor/source/browse/#svn/trunk/api-proxy-php" href="http://code.google.com/p/gfwinterceptor/source/browse/#svn/trunk/api-proxy-php">http://code.google.com/p/gfwinterceptor/source/browse/#svn/trunk/api-proxy-php</a></p>
<p>其中 svn 还是强烈推荐的，虽然文件可能要移动一下，不过这样可以确保在 copy / paste 时候不出错误。</p>
<h2>2，代码安装</h2>
<p><a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 的安装还是十分简单的，首先确认你的服务器使用的是 Apache httpd，并且开启了 mod_rewrite 支持，php 方面需要有 cURL 模块。没问题的话，把 index.php 和 .htaccess 这两个文件放到服务器的某个目录就可以了，完全不需要进行代码修改以及权限设置。</p>
<h2>3，测试安装</h2>
<p>&nbsp;</p>
<p>首先在电脑上用浏览器打开一下 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> PHP server 所在的目录，看看有没有报错信息，显示白板一块就对了。如果报 error 500 internal server error 服务器内部错误的话，很可能是你的服务器 Apache 没有启用 mod_headers。如果你有操作 apache 权限的话，直接</p>
<pre>sudo a2enmod headers</pre>
<p>加载 mod_headers 的配置文件，并重新启动 Apache 即可。如果服务器不是你的话，那你只能退而求其次，将 .htaccess 中下面这段删掉了，副作用是 4sq 无法 check-in，<a href="http://www.google.org.cn/tag/facebook" target="_blank">facebook</a> 无法登陆。不过你可以将备用服务器（图床服务器）保留默认的 appspot.com 地址，0.61 以后版本的 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 会将 4sq check-in 之类的请求直接走备用服务器。</p>
<pre>#&lt;Files ~ "*.php"&gt;
SetEnvIf content-type ([^m].*) NEW_CONTENT_TYPE=$1
SetEnvIf content-type (multipart/form-data)(.*) NEW_CONTENT_TYPE=multipart/form-data-alternate$2 OLD_CONTENT_TYPE=$1$2
RequestHeader unset content-type
RequestHeader append content-type %{NEW_CONTENT_TYPE}e env=NEW_CONTENT_TYPE
#&lt;/Files&gt;</pre>
<h2>4，开始使用吧</h2>
<p>在<a href="http://b.gkp.cc/2010/08/16/gfwinterceptor-is-another-gfw-fucker/" target="_blank">安装好 GFWInterceptor</a> 的 iDevice 上进入 Settings –&gt; GFWInterceptor，将主力服务器设置成你安装 PHP 服务器端文件的地址，注意开头的 http:// 不要省略。图床服务器则根据个人情况，有 mod_headers 的话完全也可以用自己的服务器。之后确认第一个选项在启动状态，保存退出，我这里需要 respring 一下，但是据 <a href="http://twitter.com/overboming " target="_blank">@overboming</a> 说他那里则不用。</p>
<p>依次打开 <a href="http://www.google.org.cn/tag/twitter" target="_blank">twitter</a> for iPhone，4sq，Facebook 试试看吧，目前这三个应用除了 4sq check-in 后的 mayor 皇冠等几个图片不能显示外，应该已经完美了。</p>
<h2>5，关于安全</h2>
<p>首先我认为所有 Fuck-GFW 的服务都应该保持 private，所有公开的服务都会在瞬间被干掉，经过我的实测，北京移动 edge 用户已经无法访问 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 的默认 appspot 服务器了。所以我强烈建议自己搭建 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 服务器的用户也将服务器保持私有状态，仅限自己和好友使用。更何况现在 <a href="http://iFuckGFW.com" target="_blank">GFWInterceptor</a> 的服务端还没有验证机制，也就是说任何人只要知道你的服务器地址就可以用。大家可以将服务器路径设置的诡异一些，有条件的甚至可以在非标准端口上开一个虚拟主机，这样被猜到的可能性就大大降低了。</p>
<p>不过 <a href="http://twitter.com/overboming " target="_blank">@overboming</a> 已经<a href="http://code.google.com/p/gfwinterceptor/issues/detail?id=14" target="_blank">确认</a>在下个大升级中将加入 token 验证机制，手机端转发请求时将在 HTTP_HEADER 中包含一个 token，服务器端收到后会先验证 token，没有问题才放行，届时安全性将大大改善。</p>
<p>最后一个建议，就是尽量使用 https 加密连接，twitter for <a href="http://android.google.org.cn/tag/iphone" target="_blank">iPhone</a> 已经是全 OAuth，但是最新的 Facebook 登录时密码还是明文发送的，存在被居心不良的人截获的可能性。</p>
<p>最后说下我今天晚上犯的错误吧，我是直接在 <a href="http://www.google.org.cn/tag/chrome" target="_blank">Chrome</a> 中复制代码，然后到 iterm 中 vi 粘贴，结果不小心在代码开头的 &lt;? 前面多复制了一个空行，导致 twitter / Facebook 报告 xml 数据前有垃圾数据，折腾了好久，所以大家最好还是 svn 吧，最起码避免了复制代码出错的可能性。</p>
<p>基本安装就是这样，如果遇到问题可以留言或者在 twitter <a href="http://twitter.com/gokeeper" target="_blank">@gokeeper</a>，我会尽我所能帮大家解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/08/17/setup-php-proxy-server-for-gfwinterceptor/feed/</wfw:commentRss>
		<slash:comments>107</slash:comments>
		</item>
		<item>
		<title>搭建支持 OAuth Echo 的第三方 twitter 应用</title>
		<link>http://b.gkp.cc/2010/08/16/twitter-for-iphone-custom-image-endpoint-and-twitter-oauth-echo/</link>
		<comments>http://b.gkp.cc/2010/08/16/twitter-for-iphone-custom-image-endpoint-and-twitter-oauth-echo/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 03:46:17 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[imggd]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/2010/08/16/twitter-for-iphone-custom-image-endpoint-and-twitter-oauth-echo/</guid>
		<description><![CDATA[背景：进入8月中，twitter 已经在每天减少 Basic Auth 的 API limit了，到月底 Basic Auth 将彻底关闭，也就是说到月底，所有的客户端，twitter与第三方服务之间都必须使用 OAuth 来传递帐号密码等信息。 我喜欢 twitter for iPhone 的很大一个原因就是其支持自定义图片服务，3.0 以及之前的版本使用 Basic Auth 自建图片服务很容易，只要处理一下提交过来的 multipart/form-data 就行了，但是相应的安全性比较低——密码用明文传送，所以 atebits 强烈推荐用 https，并且曾经计划在后续版本强制 https。当然现在都 OAuth 了，这个问题也就不存在了。 twitter for iPhone 升级到 3.01 以后，就一直有人说其有 bug，自定义 API 和 自定义图片服务都不能用，这个 &#34;bug&#34; &#8230; <a href="http://b.gkp.cc/2010/08/16/twitter-for-iphone-custom-image-endpoint-and-twitter-oauth-echo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img title="imggd_oauth_echo" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="288" alt="imggd_oauth_echo" src="http://b.gkp.cc/files/2010/08/imggd_oauth_echo.png" width="552" border="0" /> </p>
<p>背景：进入8月中，<a href="http://www.google.org.cn/tag/twitter" target="_blank">twitter</a> 已经在每天减少 Basic Auth 的 API limit了，到月底 Basic Auth 将彻底关闭，也就是说到月底，所有的客户端，twitter与第三方服务之间都必须使用 OAuth 来传递帐号密码等信息。</p>
<p>我喜欢 twitter for <a href="http://android.google.org.cn/tag/iphone" target="_blank">iPhone</a> 的很大一个原因就是其支持自定义图片服务，3.0 以及之前的版本使用 Basic Auth 自建图片服务很容易，只要处理一下提交过来的 multipart/form-data 就行了，但是相应的安全性比较低——密码用明文传送，所以 atebits 强烈推荐用 https，并且曾经计划在后续版本强制 https。当然现在都 OAuth 了，这个问题也就不存在了。</p>
<p>twitter for iPhone 升级到 3.01 以后，就一直有人说其有 bug，自定义 API 和 自定义图片服务都不能用，这个 &quot;bug&quot; 一直持续到了 3.03a。。。昨天偶然和 <a href="http://twitter.com/2046" target="_blank">@2046</a> 聊起这个事情，才突然明白这根本不是什么 bug，而是新版的 twitter for iPhone 已经开始用 oAuth 将用户信息打包提交了，所以导致之前在 expect basic auth 的 API Proxy 以及 自定义图片服务都歇菜了，包括 <a href="http://img.gd" target="_blank">img.gd</a> 与 <a href="http://code.google.com/p/twip/" target="_blank">twip</a> 。。。</p>
<p>这里要强烈谴责一下 twitter 的官方网站，直到现在 twitter for iPhone 的<a href="http://support.twitter.com/groups/34-mobile/topics/126-carriers-apps/articles/170511-twitter-for-iphone-advanced-features" target="_blank">支持页面</a>里面还是让大家去 atebits 的 developer 页面看<a href="http://developer.atebits.com/tweetie-iphone/custom-image/" target="_blank">老掉牙的信息</a>，严重误导。实际上现在 twitter 使用 OAuth Echo 为类似的第三方服务进行验证，基本原理可以参考这（<a href="http://dev.twitter.com/pages/oauth_echo" target="_blank">1</a>，<a href="http://www.scribd.com/doc/26707268/OAuth-Echo-Identity-Veri%EF%AC%81cation-Delegation-Draft" target="_blank">2</a>）篇文档，基本流程如下图：</p>
<p> <span id="more-1452"></span>
<p><a href="http://b.gkp.cc/files/2010/08/oauth_echo.png" target="_blank"><img title="oauth_echo" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="482" alt="oauth_echo" src="http://b.gkp.cc/files/2010/08/oauth_echo_thumb.png" width="519" border="0" /></a> </p>
<p>以 twitter for iPhone 发图到 img.gd 为例：</p>
<ol>
<li>twitter for iPhone 将 multipart/form-data POST 到 img.gd 的 ending point，包括图片以及 $_POST['message']，即 tweet 主体。</li>
<li>POST multipart/form-data 的同时，HTTP HEADER 中会包含关键的 OAuth 信息：X-Auth-Service-Provider （验证 url） 以及 X-Verify-Credentials-Authorization （OAuth 信息主体，包括 token 等）。</li>
<li>img.gd 收到 POST 后，将 HTTP HEADER 中的 X-Verify-Credentials-Authorization 改名为 Authorization 提交到 X-Auth-Service-Provider （这里就是 twitter）验证。</li>
<li>如果 twitter 返回 HTTP CODE 200 的话，表示验证成功，同时会返回一个 json 格式的用户 object。</li>
<li>img.gd 读取 twitter 返回的 json 数据，存储图片，返回图片 url 给 twitter for iPhone。</li>
</ol>
<p>最终效果如本文题图，这样终于可以放心升级到 twitter for iPhone 3.03a了，twitter 本身走 <a href="http://code.google.com/p/gfwinterceptor/" target="_blank">#GFWInterceptor</a> 图片则直接 OAuth Echo 到 img.gd，赞！</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/08/16/twitter-for-iphone-custom-image-endpoint-and-twitter-oauth-echo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>img.gd 20100729更新，加入 #tag 功能</title>
		<link>http://b.gkp.cc/2010/07/28/imggd-29th-july-2010-update/</link>
		<comments>http://b.gkp.cc/2010/07/28/imggd-29th-july-2010-update/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 18:04:55 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的慵懒生活]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[imggd]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/2010/07/28/imggd-29th-july-2010-update/</guid>
		<description><![CDATA[虽然 twitter 因为世界杯的原因将 Basic Auth 的死期推迟到了8月16日，但是该来的总会来的。之前 img.gd 读取用户信息并在本地 cache 的函数使用的正是 Basic Auth ，于是趁着 @musiXboy 需要加 #tag 功能的机会重写了这个函数，全面 OAuth 化了。另外还简化了一些代码，修复 bug，具体更新如下： 全面 OAuth 化 加入可以点击的 #tag 功能，加入 tag 页面，例如：http://img.gd/tags/google 和 twitter 一样的字符长度处理，中英文字符都算1个字，修复了之前出现过错误计算 tweet 长度的问题 另外，由于 img.gd 代码脆弱，所以未来相当长一段时间内这个服务将保持现在的私人性质，sorry。]]></description>
			<content:encoded><![CDATA[<p><img title="Oauth" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="444" alt="Oauth" src="http://b.gkp.cc/files/2010/07/Oauth.jpg" width="497" border="0" /> </p>
<p>虽然 <a href="http://www.google.org.cn/tag/twitter" target="_blank">twitter</a> 因为世界杯的原因将 Basic Auth 的死期<a href="http://mashable.com/2010/06/17/oauthcalypse-delayed/" target="_blank">推迟</a>到了8月16日，但是该来的总会来的。之前 img.gd 读取用户信息并在本地 cache 的函数使用的正是 Basic Auth ，于是趁着 <a href="http://twitter.com/musiXboy" target="_blank">@musiXboy</a> 需要加 #tag 功能的机会重写了这个函数，全面 OAuth 化了。另外还简化了一些代码，修复 bug，具体更新如下：</p>
<ul>
<li>全面 OAuth 化</li>
<li>加入可以点击的 #tag 功能，加入 tag 页面，例如：<a title="http://img.gd/tags/google" href="http://img.gd/tags/google">http://img.gd/tags/google</a></li>
<li>和 twitter 一样的字符长度处理，中英文字符都算1个字，修复了之前出现过错误计算 tweet 长度的问题</li>
</ul>
<p>另外，由于 <a href="http://img.gd" target="_blank">img.gd</a> 代码脆弱，所以未来相当长一段时间内这个服务将保持现在的私人性质，sorry。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/07/28/imggd-29th-july-2010-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>修改了一下谷奥的 twitter-tools 插件</title>
		<link>http://b.gkp.cc/2010/07/19/twitter-tools-plugin-hacked/</link>
		<comments>http://b.gkp.cc/2010/07/19/twitter-tools-plugin-hacked/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 19:15:01 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[guao]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/?p=1340</guid>
		<description><![CDATA[&#160; 在最后的短网址后面加入了仿效 TechCrunch 更新的作者提示，比如 by @gokeeper。另外也改走 OAuth 的 ，防止下个月停止 Basic Auth 后抓狂。目前看来一切正常，在观察观察。]]></description>
			<content:encoded><![CDATA[<p><img title="tiwtter_tools_hacked" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="57" alt="tiwtter_tools_hacked" src="http://b.gkp.cc/files/2010/07/tiwtter_tools_hacked.png" width="400" border="0" />&#160; </p>
<p>在最后的短网址后面加入了仿效 TechCrunch 更新的作者提示，比如 by @gokeeper。另外也改走 OAuth 的 ，防止下个月停止 Basic Auth 后抓狂。目前看来一切正常，在观察观察。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2010/07/19/twitter-tools-plugin-hacked/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>img.gd 12月28日更新，自动缩图，修复bug</title>
		<link>http://b.gkp.cc/2009/12/28/imgge-20091228-update/</link>
		<comments>http://b.gkp.cc/2009/12/28/imgge-20091228-update/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 06:04:52 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[imggd]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/posts/imgge-20091228-update.html</guid>
		<description><![CDATA[开放邮件上传后，发现手机拍摄直接发过来的图片很大（1m+），所以现在对发过来的图片进行缩小，最大尺寸620*800，原始尺寸存为full-filename，在查看全尺寸页面显示。现图片共有四种规格。 full-filename -&#160; 原图，尺寸不限 filename - 标准显示图片，尺寸 &#60; 620 x 800 150-filename - 150x150缩略图 75-filename – 75x75缩略图 其他更新： gb2312编码中文处理问题，用了一个通用的解决办法，理论上所有编码的邮件主题都可以正确识别了 修复把email地址加到地址薄后，邮件To属性变化后无法正确提取用户名和用户pin的bug]]></description>
			<content:encoded><![CDATA[<p>开放邮件上传后，发现手机拍摄直接发过来的图片很大（1m+），所以现在对发过来的图片进行缩小，最大尺寸620*800，原始尺寸存为full-filename，在查看全尺寸页面显示。现图片共有四种规格。</p>
<ul>
<li>full-filename -&#160; 原图，尺寸不限</li>
<li>filename - 标准显示图片，尺寸 &lt; 620 x 800</li>
<li>150-filename - 150x150缩略图</li>
<li>75-filename – 75x75缩略图</li>
</ul>
<p>其他更新：</p>
<ul>
<li>gb2312编码中文处理问题，用了一个通用的解决办法，理论上所有编码的邮件主题都可以正确识别了</li>
<li>修复把email地址加到地址薄后，邮件To属性变化后无法正确提取用户名和用户pin的bug</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2009/12/28/imgge-20091228-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>img.gd 20091217 更新</title>
		<link>http://b.gkp.cc/2009/12/17/img-gd-20091217-update/</link>
		<comments>http://b.gkp.cc/2009/12/17/img-gd-20091217-update/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 19:35:40 +0000</pubDate>
		<dc:creator>gkp</dc:creator>
				<category><![CDATA[我的工作学习]]></category>
		<category><![CDATA[电脑相关]]></category>
		<category><![CDATA[imggd]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://b.gkp.cc/?p=1276</guid>
		<description><![CDATA[更新： 放弃单独的头像缓存函数。导入用户表，用户资料和头像保存本地，过期时间一周，大大减少api请求次数。]]></description>
			<content:encoded><![CDATA[<div><img class="aligncenter size-full wp-image-1278" src="http://b.gkp.cc/wp-content/uploads/2009/12/imggd_users.png" alt="imggd_users" width="355" height="147" /></div>
<div>更新：</div>
<ul>
<li>放弃单独的头像缓存函数。导入用户表，用户资料和头像保存本地，过期时间一周，大大减少api请求次数。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://b.gkp.cc/2009/12/17/img-gd-20091217-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

