源码make编译nginx时报错:如下
/bin/sh: line 0: cd: /usr/local/src/pcre-8.35: No such file or directory
objs/Makefile:1133: recipe for target '/usr/local/src/pcre-8.35/Makefile' failed
make[1]: *** [/usr/local/src/pcre-8.35/Makefile] Error 1
make[1]: Leaving directory '/root/Downloads/nginx-1.6.2'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
错误原因:
./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
这里最后一个参数是pcre的地址,由错误 cd: /usr/local/src/pcre-8.35: No such file or directory可以看出来,这是没有找到pcre-8.35的路径,看了以下help文件:
发现--with-pcre = DIR set path to pcre library sources这个路径是要指向pcre的源码路径,发现这一点之后,修改路径即可。
./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/root/Download/pcre-8.35
注意上述/root/Download/pcre1.6.0是我pcre解压后的路径,即为pcre的源码