---
title: "MongoDB GridFS介绍与nginx-gridfs编译问题"
author: "kimmking"
date: "2012-03-05T20:50:46Z"
tags: []
categories: ["开源软件"]
slug: "mongodb-gridfs-nginx-gridfs"
draft: false
lastmod: "2012-03-05T20:50:46Z"
id: 1441086
url: "https://setting.iteye.com/blog/1441086"
---

# [MongoDB GridFS 介绍 PPT 两则](http://www.oschina.net/question/12_28876)

[http://www.oschina.net/question/12\_28876](http://www.oschina.net/question/12_28876)

规范

[http://www.mongodb.org/display/DOCS/GridFS+Specification](http://www.mongodb.org/display/DOCS/GridFS+Specification)

文档

[http://www.mongodb.org/display/DOCS/GridFS](http://www.mongodb.org/display/DOCS/GridFS)

示例

[http://blog.csdn.net/zhangzhaokun/article/details/6287309](http://blog.csdn.net/zhangzhaokun/article/details/6287309)

[http://www.open-open.com/lib/view/open1330171884015.html](http://www.open-open.com/lib/view/open1330171884015.html)

nginx-gridfs编译

1、编译时，报错：  
src/core/ngx\_times.c: In function ‘ngx\_time\_update’:  
src/core/ngx\_times.c:136: error: ‘timezone’ undeclared (first use in this function)  
src/core/ngx\_times.c:136: error: (Each undeclared identifier is reported only once  
src/core/ngx\_times.c:136: error: for each function it appears in.)  
make\[1]: \*\** \[objs/src/core/ngx\_times.o] Error 1  
make: \*\** \[build] Error 2

这是因为在nginx中，timezone是作为函数使用的。而在cgwin环境下，把timezone当成了个变量。  
修改头文件os\\unix\\ngx\_posix\_config.h中timezone的定义：  
#define timezonevar  
改为：  
extern long timezone \_\_asm\__ ("\_\_timezone");  
再编译即可。

cgywin timezone的问题，具体请参照（[http://cygwin.com/ml/cygwin/2008-01/msg00449.html](http://cygwin.com/ml/cygwin/2008-01/msg00449.html)）

2、由于gcc*编译*时指定的选项-*Werror*导致的，将所有的警告视为错误。可以在Makefile中将它去掉。