环境:
ubuntu 18.04.1
fastdfs-nginx-module_v1.16
root@wang-machine:~/桌面/FastDFS# cd nginx-1.8.1/
root@wang-machine:~/桌面/FastDFS/nginx-1.8.1# sudo ./configure --prefix=/usr/local/nginx/ --add-module=/home/wang/桌面/FastDFS/fastdfs-nginx-module/src
root@wang-machine:~/桌面/FastDFS/nginx-1.8.1# make
若提示: error: this statement may fall through [-Werror=implicit-fallthrough=]
则进入/nginx-1.8/objs/Makefile 找到 -Werrori 后将其去掉 在重新make编译就可以了。
接着提示:
/home/wang/桌面/FastDFS/fastdfs-nginx-module/src/common.c:21:10: fatal error: fdfs_define.h: 没有那个文件或目录
#include "fdfs_define.h"
^~~~~~~~~~~~~~~
compilation terminated.
objs/Makefile:1098: recipe for target 'objs/addon/src/ngx_http_fastdfs_module.o' failed
敲入命令创建软连接:
ln -sv /usr/include/fastcommon /usr/local/include/fastcommon
ln -sv /usr/include/fastdfs /usr/local/include/fastdfs
ln -sv /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
再次make
sudo make install
OK。
此问题捣鼓了整整24小时,自学艰辛,记录一下。
感谢http://bbs.chinaunix.net/thread-4162818-1-1.html