2013-02-16 206 views
0

我在用Ubuntu 12.04.1 LTS的PCRE庫編譯ngnix時遇到問題。配置運行正常但make命令失敗。我對nginx和Linux相當陌生,因此我不確定問題在哪。在ubuntu上用pcre編譯nginx問題

安裝步驟:

./configure --add-module=/home/ubuntu/mod_zip/mod_zip-master --with-http_image_filter_module --without-http_rewrite_module --with-pcre=../pcre-8.32 
make 
make install 

錯誤

cd ../pcre-8.32 \ 
     && make libpcre.la 
make[2]: Entering directory `/home/ubuntu/pcre-8.32' 
    CC  libpcre_la-pcre_byte_order.lo 
    CC  libpcre_la-pcre_compile.lo 
    CC  libpcre_la-pcre_config.lo 
    CC  libpcre_la-pcre_dfa_exec.lo 
    CC  libpcre_la-pcre_exec.lo 
    CC  libpcre_la-pcre_fullinfo.lo 
    CC  libpcre_la-pcre_get.lo 
    CC  libpcre_la-pcre_globals.lo 
    CC  libpcre_la-pcre_jit_compile.lo 
    CC  libpcre_la-pcre_maketables.lo 
    CC  libpcre_la-pcre_newline.lo 
    CC  libpcre_la-pcre_ord2utf8.lo 
    CC  libpcre_la-pcre_refcount.lo 
    CC  libpcre_la-pcre_string_utils.lo 
    CC  libpcre_la-pcre_study.lo 
    CC  libpcre_la-pcre_tables.lo 
    CC  libpcre_la-pcre_ucd.lo 
    CC  libpcre_la-pcre_valid_utf8.lo 
    CC  libpcre_la-pcre_version.lo 
    CC  libpcre_la-pcre_xclass.lo 
rm -f pcre_chartables.c 
ln -s ./pcre_chartables.c.dist pcre_chartables.c 
    CC  libpcre_la-pcre_chartables.lo 
    CCLD libpcre.la 
make[2]: Leaving directory `/home/ubuntu/pcre-8.32' 
gcc -o objs/nginx \ 
     objs/src/core/nginx.o \ 
     objs/src/core/ngx_log.o \ 
     objs/src/core/ngx_palloc.o \ 
     objs/src/core/ngx_array.o \ 
     ... 
     ... 
     ... 
     objs/addon/mod_zip-master/ngx_http_zip_module.o \ 
     objs/addon/mod_zip-master/ngx_http_zip_parsers.o \ 
     objs/addon/mod_zip-master/ngx_http_zip_file.o \ 
     objs/addon/mod_zip-master/ngx_http_zip_headers.o \ 
     objs/ngx_modules.o \ 
     -lpthread -lcrypt ../pcre-8.32/.libs/libpcre.a -lcrypto -lcrypto -lz -lgd 
objs/src/core/nginx.o: In function `main': 
/home/ubuntu/nginx-1.2.6/src/core/nginx.c:275: undefined reference to `ngx_regex_init' 
objs/src/http/ngx_http_core_module.o: In function `ngx_http_gzip_disable': 
/home/ubuntu/nginx-1.2.6/src/http/ngx_http_core_module.c:4918: undefined reference to `ngx_regex_compile' 
objs/src/http/ngx_http_core_module.o: In function `ngx_http_gzip_ok': 
/home/ubuntu/nginx-1.2.6/src/http/ngx_http_core_module.c:2218: undefined reference to `ngx_regex_exec_array' 
objs/src/http/ngx_http_variables.o: In function `ngx_http_regex_compile': 
/home/ubuntu/nginx-1.2.6/src/http/ngx_http_variables.c:2074: undefined reference to `ngx_regex_compile' 
objs/src/http/modules/ngx_http_ssi_filter_module.o: In function `ngx_http_ssi_regex_match': 
/home/ubuntu/nginx-1.2.6/src/http/modules/ngx_http_ssi_filter_module.c:1882: undefined reference to `ngx_regex_compile' 
objs/src/http/modules/ngx_http_referer_module.o: In function `ngx_http_referer_variable': 
/home/ubuntu/nginx-1.2.6/src/http/modules/ngx_http_referer_module.c:197: undefined reference to `ngx_regex_exec_array' 
objs/src/http/modules/ngx_http_referer_module.o: In function `ngx_http_add_regex_referer': 
/home/ubuntu/nginx-1.2.6/src/http/modules/ngx_http_referer_module.c:582: undefined reference to `ngx_regex_compile' 
objs/src/http/modules/ngx_http_fastcgi_module.o: In function `ngx_http_fastcgi_split_path_info': 
/home/ubuntu/nginx-1.2.6/src/http/modules/ngx_http_fastcgi_module.c:2891: undefined reference to `ngx_regex_compile' 
collect2: ld returned 1 exit status 
make[1]: *** [objs/nginx] Error 1 
make[1]: Leaving directory `/home/ubuntu/nginx-1.2.6' 
make: *** [build] Error 2 

謝謝!

+0

我試過了,但是失敗了,重現了這個問題,因爲我無法理解基於你發佈的輸出的錯誤。您能否將整個輸出和您的命令發佈到pastebin之類的地方? – 2013-02-17 08:31:20

回答

0

指定不使用重寫模塊,這意味着Nginx不應該需要pcre。但是,然後你指定pcre的位置。

我認爲你應該刪除--with-pcre =參數,那麼它應該沒問題。如果你不使用重寫模塊,你不需要任何東西。

+0

我試圖包含pcre的原因是它需要在位置中使用正則表達式。 – user2077354 2013-02-17 22:42:38

+0

嘗試不禁用mod重寫。我認爲它應該工作 – 2013-02-18 01:05:54

+0

就是這樣,謝謝! – user2077354 2013-02-18 16:48:36