Archive

Posts Tagged ‘php’

解决nginx和php-fastcgi上传大文件的问题

October 3rd, 2009 Wei No comments

近来需要在blog中上传一些比较大的照片,却发现无论是Flash Uploader还是Web Uploader均无法上传。经过一番试验,发现这种情况仅发生在上传较大图片的时候,而对于几百KB的图片却不出现问题。

我的Server使用了nginx和php-fastcgi,经过检查php的配置文件,发现upload_max_filesize、post_max_size都不应该会影响上传。从phpinfo()来看,这些配置也都正确读入了。经过查看/var/log/nginx/error.log,发现其最下面几行出现日志:

2009/10/03 22:06:23 [error] 6029#0: *20 client intended to send too large body: 1345385 bytes, client: x.x.x.x, server: weigblog.com, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "www.weigblog.com"

既然log是nginx报出来的,那问题自然出现在nginx上。经过查询nginx的wiki,解决方案如下:

在/etc/nginx/nginx.conf中添加如下配置:

http {
        ...
        client_max_body_size 100m;
        ...
}

之后运行/etc/init.d/nginx reload重新载入配置文件,上传搞定。

WordPress Plug-in: FeedBurner StandardStats

February 7th, 2007 Wei No comments

新做了一个WordPress的插件,取名为FeedBurner StandardStats;用来实现FeedBurner提供的统计功能。

改自Google Analyticator

安装

  1. 解压缩下载的zip文件
  2. 复制fb_standardstats.php文件到wp-content\plugins目录中(或复制整个目录)
  3. 在Plugins中Activate插件
  4. 去Options->FeedBurner StandardStats中启用该插件,并输入在StandardStats中提示feed的UserID

下载

Categories: WordPress Tags: , ,