11.执行命令 systemctl status nginx.service 查看 tengine 的运行状态(如果 Active 状态是 running 的,则代表 tengine 启动成功):
1
systemctl status nginx.service
报错及解决方法
configure 报错
错误一:error: the geoip2 module requires the maxminddb library.
报错信息:
1 2 3
adding module in /usr/local/src/ngx_http_geoip2_module checking for MaxmindDB library ... not found ./configure: error: the geoip2 module requires the maxminddb library.
错误二:error: the HTTP XSLT module requires the libxml2/libxslt
报错及解决方法错信息:
1 2 3 4 5 6 7 8
checking for OpenSSL DTLS support ... not found checking for libxslt ... not found checking for libxslt in /usr/local/ ... not found checking for libxslt in /usr/pkg/ ... not found checking for libxslt in /opt/local/ ... not found
./configure: error: the HTTP XSLT module requires the libxml2/libxslt libraries. You can either do not enable the module or install the libraries.
解决方法:
安装 libxml2-dev
1
apt install -y libxml2-dev libxslt1-dev
错误三:error: the HTTP image filter module requires the GD library.
报错信息:
1 2 3 4 5 6 7 8 9 10
hecking for OpenSSL DTLS support ... not found checking for libxslt ... found checking for libexslt ... found checking for GD library ... not found checking for GD library in /usr/local/ ... not found checking for GD library in /usr/pkg/ ... not found checking for GD library in /opt/local/ ... not found
./configure: error: the HTTP image filter module requires the GD library. You can either do not enable the module or install the libraries.
解决方法:
安装 libgd-dev
1
apt install -y libgd-dev
错误四:error: the GeoIP module requires the GeoIP library.
报错信息:
1 2 3 4 5 6 7
checking for GeoIP library ... not found checking for GeoIP library in /usr/local/ ... not found checking for GeoIP library in /usr/pkg/ ... not found checking for GeoIP library in /opt/local/ ... not found
./configure: error: the GeoIP module requires the GeoIP library. You can either do not enable the module or install the library.
解决方法:
安装 libgeoip-dev
1
apt install -y libgeoip-dev
报错五:error: the Google perftools module requires the Google perftools
报错信息:
1 2 3 4 5 6
checking for Google perftools ... not found checking for Google perftools in /usr/local/ ... not found checking for Google perftools in /opt/local/ ... not found
./configure: error: the Google perftools module requires the Google perftools library. You can either do not enable the module or install the library.
解决方法:
安装 libgoogle-perftools-dev
1
apt install -y libgoogle-perftools-dev
报错六: error: Libtool library used but ‘LIBTOOL’ is undefined
# 安装 libatomic_ops 执行 autogen.sh 时报: veazhi@vm002-ubuntu2204:/usr/local/src/libatomic_ops$ sudo ./autogen.sh src/Makefile.am:14: error: Libtool library used but 'LIBTOOL' is undefined src/Makefile.am:14: The usual way to define 'LIBTOOL' is to add 'LT_INIT' src/Makefile.am:14: to 'configure.ac' and run 'aclocal' and 'autoconf' again. src/Makefile.am:14: If 'LT_INIT' is in'configure.ac', make sure src/Makefile.am:14: its definition is in aclocal's search path. autoreconf: error: automake failed with exit status: 1 # 安装 libatomic_ops 执行 ./configure --prefix=/usr/local/libatomic_ops 时报: veazhi@vm002-ubuntu2204:/usr/local/src/libatomic_ops$ sudo ./configure --prefix=/usr/local/libatomic_ops checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking dependency style of gcc... gcc3 ./configure: line 4688: syntax error near unexpected token `disable-shared' ./configure: line 4688: `LT_INIT(disable-shared)'
解决方法:
安装 libtool 即可.
1
apt install -y libtool
make 报错:
错误一: error: Invalid C++ compiler or C++ compiler flags
报错信息:
1 2 3 4 5
checking for windows.h... no configure: error: Invalid C++ compiler or C++ compiler flags make[1]: *** [objs/Makefile:2230: /usr/local/src/pcre-8.45//Makefile] Error 1 make[1]: Leaving directory '/usr/local/src/tengine-3.1.0' make: *** [Makefile:10: build] Error 2
解决方法:
安装 build-essential 即可!
1
apt install -y build-essential
错误二:cannot find /usr/local/src/libatomic_ops/src/libatomic_ops.a: No such file or directory
报错信息:
1 2 3 4 5
/usr/bin/ld: cannot find /usr/local/src/libatomic_ops/src/libatomic_ops.a: No such file or directory collect2: error: ld returned 1 exit status make[1]: *** [objs/Makefile:381: objs/nginx] Error 1 make[1]: Leaving directory '/usr/local/src/tengine-3.1.0' make: *** [Makefile:10: build] Error 2