开发者社区> 问答> 正文

osx ei capitan 10.11.1 (15B42) make ngin?报错

我的系统是:osx ei capitan 10.11.1 (15B42)

从nginx官方网站下载 nginx-1.9.5.tar.gz

tar xzf nginx-1.9.5.tar.gz

cd nginx-1.9.5

./configure --prefix=/usr/local/nginx --without-http_rewrite_module --with-http_ssl_module


objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \

objs/src/http/modules/ngx_http_upstream_least_conn_module.o \

objs/src/http/modules/ngx_http_upstream_keepalive_module.o \

objs/src/http/modules/ngx_http_upstream_zone_module.o \

objs/ngx_modules.o \

-lssl -lcrypto -lz

Undefined symbols for architecture x86_64:

  "_SSL_CTX_set_alpn_select_cb", referenced from:

      _ngx_http_ssl_merge_srv_conf in ngx_http_ssl_module.o

  "_SSL_CTX_set_next_protos_advertised_cb", referenced from:

      _ngx_http_ssl_merge_srv_conf in ngx_http_ssl_module.o

  "_SSL_select_next_proto", referenced from:

      _ngx_http_ssl_alpn_select in ngx_http_ssl_module.o

  "_X509_check_host", referenced from:

      _ngx_ssl_check_host in ngx_event_openssl.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [objs/nginx] Error 1

make: *** [build] Error 2

Downloads/nginx-1.9.5 » 

不带 --without-http_rewrite_module --with-http_ssl_module 可以安装成功,但我我需要支持https

求高手指点 ?

展开
收起
爱吃鱼的程序员 2020-06-12 10:33:39 508 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    用--with-cc-opt和--with-ld-opt指定openssl头文件和库文件的路径

    又或者用--with-openssl=/the/path/to/openssl/source/code/指定openssl源代码的路径

    回复 @无名码农:非常感谢啊,弄好了回复 @leeyi:set是ngx_http_rewrite_module提供的指令回复 @leeyi:去掉--without-http_rewrite_modulemake通过了,但是nginx-t报错:[emerg]12964#0:unknowndirective"set"in/usr/local/nginx/conf/nginx.conf:71参考nginx.org/en/docs/configure.html./configure--prefix=/usr/local/nginx--without-http_rewrite_module--with-http_ssl_module--with-cc-opt="-I/usr/local/include"--with-ld-opt="-L/usr/local/lib"下载了最新版本openssl解压之后指定到了--with-openssl=包其他错误

    我本地openssl只用brew安装的最新版本 

    /usr/local/Cellar/openssl/1.0.2d_1

    make之后还是报错,步骤和错误如下:

    tarxzfnginx-1.9.5.tar.gz

    cd nginx-1.9.5

    ./configure--prefix=/usr/local/nginx--without-http_rewrite_module--with-http_ssl_module--with-openssl=/Users/leeyi/Downloads/openssl-1.0.2d

    "_i2d_SSL_SESSION",referencedfrom:

       _ngx_ssl_new_sessioninngx_event_openssl.o

       _ngx_http_upstream_save_round_robin_peer_sessioninngx_http_upstream_round_robin.o

     "_sk_num",referencedfrom:

       _ngx_ssl_session_cacheinngx_event_openssl.o

       _ngx_ssl_staplinginngx_event_openssl_stapling.o

     "_sk_value",referencedfrom:

       _ngx_ssl_session_cacheinngx_event_openssl.o

       _ngx_ssl_staplinginngx_event_openssl_stapling.o

    ld:symbol(s)notfoundforarchitecturex86_64

    clang:error:linkercommandfailedwithexitcode1(use-vtoseeinvocation)

    make[1]:***[objs/nginx]Error1

    make:***[build]Error2

    看评价很多说升级了之后变卡功能不好用的

    看了下自己的版本还是10.10.5还好

    2020-06-12 10:33:55
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
在Linux下安...[xubingit].1460269862.pdf 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载