checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found! 复制代码 代码如下: yum -y install unixODBC-devel
1 2 3
configure: error: Unable to detect ICU prefix or /usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works. 复制代码 代码如下: yum -y install libicu-devel
1 2 3
configure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information. 复制代码 代码如下: yum -y install libc-client-devel
configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/ 复制代码 代码如下: yum -y install libcurl-devel
1 2 3 4 5 6 7
configure: error: mcrypt.h not found. Please reinstall libmcrypt. 复制代码 代码如下: wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz tar zxf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7 ./configure make && make install
configure: error: Please reinstall the lib curl distribution 复制代码 代码如下: yum -y install curl-devel
1 2 3
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation. 复制代码 代码如下: yum -y install net-snmp-devel
1 2 3
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution 复制代码 代码如下: yum -y install libxslt-devel
1 2 3 4 5
checking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution
Fix: 复制代码 代码如下: yum -y install bzip2-devel
1 2 3 4 5
checking for cURL support… yes checking if we should use cURL for url streams… no checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution – easy.h should be in/include/curl/
Fix: 复制代码 代码如下: yum -y install curl-devel
1 2 3 4 5
checking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).
Fix: 复制代码 代码如下: yum -y install db4-devel
1 2 3 4 5
checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.
Fix: 复制代码 代码如下: yum -y install libjpeg-devel
1 2 3 4 5
checking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found.
Fix: 复制代码 代码如下: yum -y install libpng-devel
1 2 3 4 5 6
checking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=
configure: error: freetype.h not found. Fix: 复制代码 代码如下: Reconfigure your PHP with the following option. --with-xpm-dir=/usr
1 2 3 4 5
checking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.
Fix: 复制代码 代码如下: yum -y install libXpm-devel
1 2 3 4 5
checking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.h
Fix: 复制代码 代码如下: yum -y install gmp-devel
1 2 3 4 5
checking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
Fix: 复制代码 代码如下: yum -y install libc-client-devel
1 2 3 4 5
checking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.h
Fix: 复制代码 代码如下: yum -y install openldap-devel
1 2 3 4 5
checking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!
Fix: 复制代码 代码如下: yum -y install unixODBC-devel
1 2 3 4 5
checking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
Fix: 复制代码 代码如下: yum -y install postgresql-devel
1 2 3 4 5
checking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distribution
Fix: 复制代码 代码如下: yum -y install sqlite-devel
1 2 3 4 5
checking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspell
Fix: 复制代码 代码如下: yum -y install aspell-devel
1 2 3 4 5 6 7
checking whether to enable UCD SNMP hack… yes checking for default_store.h… no
checking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.
Fix: 复制代码 代码如下: yum -y install net-snmp-devel
1 2 3 4 5
checking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Fix: 复制代码 代码如下: yum -y install libxslt-devel
1 2 3 4 5
configure: error: xml2-config not found. Please check your libxml2 installation.
Fix: 复制代码 代码如下: yum -y install libxml2-devel
1 2 3 4 5
checking for PCRE headers location… configure: error: Could not find pcre.h in /usr
Fix: 复制代码 代码如下: yum -y install pcre-devel
1 2 3 4 5
configure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!
Fix: 复制代码 代码如下: yum -y install mysql-devel
1 2 3 4 5
checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!
Fix: 复制代码 代码如下: yum -y install unixODBC-devel
1 2 3 4 5
checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
Fix: 复制代码 代码如下: yum -y install postgresql-devel
1 2 3 4 5
configure: error: Cannot find pspell
Fix: 复制代码 代码如下: yum -y install pspell-devel
1 2 3 4 5
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
Fix: 复制代码 代码如下: yum -y install net-snmp-devel
1 2 3 4 5
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Fix: 复制代码 代码如下: yum -y install libxslt-devel
1 2 3 4 5
./configure: error: the HTTP image filter module requires the GD library. You can either do not enable the module or install the libraries.
Fix: 复制代码 代码如下: yum install gd gd-devel
1 2 3 4 5
./configure: error: the GeoIP module requires the GeoIP library.
Fix: 复制代码 代码如下: yum install geoip-devel
1 2 3 4 5 6
./configure: error: the Google perftools module requires the Google perftools library. You can either do not enable the module or install the library.
Fix: 复制代码 代码如下: yum install gperftools
1 2 3 4 5 6
编译nginx时出现了下面的告警: nginx "--with-ipv6" option is deprecated
Hi, It seems you provided a wrong path to nginx, you have to provide the path of the naxsi_src directory (which would be /home/ubuntu/nginxmodule/naxsi-0.54/naxsi_src/ in your case).
3.3 nginx使用openresty时failed to load the resty.core module
报错信息如下:
1 2 3 4 5 6 7 8 9 10 11 12
nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from openresty.org/en/download.html (reason: module 'resty.core' not found: no field package.preload['resty.core'] no file './resty/core.lua' no file '/usr/local/share/luajit-2.1.0-beta3/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core/init.lua' no file './resty/core.so' no file '/usr/local/lib/lua/5.1/resty/core.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './resty.so' no file '/usr/local/lib/lua/5.1/resty.so' no file '/usr/local/lib/lua/5.1/loadall.so') in /usr/local/nginx/conf/nginx.conf:222
nginx: [alert] detected a LuaJIT version which is not OpenResty’s; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty’s LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx添加lua模块,需要准备两个模块:
ngx_devel_kit: NDK(nginx development kit)模块是一个拓展nginx服务器核心功能的模块,第三方模块开发可以基于它来快速实现。NDK提供函数和宏处理一些基本任务,减轻第三方模块开发的代码量。
lua-nginx-module: 将Lua的功能嵌入到Nginx HTTP服务器中。
1 2 3 4 5 6
$ mkdir ngx_module $ wget https://github.com/vision5/ngx_devel_kit/archive/v0.3.1.tar.gz $ tar -xvf v0.3.1.tar.gz
$ wget https://github.com/openresty/lua-nginx-module/archive/v0.10.14.tar.gz $ tar -xvf v0.10.14.tar.gz
nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from https://openresty.org/en/download.html (reason: module 'resty.core' not found: no field package.preload['resty.core'] no file './resty/core.lua' no file '/usr/local/share/luajit-2.1.0-beta3/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core.lua' no file '/usr/local/share/lua/5.1/resty/core/init.lua' no file './resty/core.so' no file '/usr/local/lib/lua/5.1/resty/core.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './resty.so' no file '/usr/local/lib/lua/5.1/resty.so' no file '/usr/local/lib/lua/5.1/loadall.so') in /usr/local/src/nginx/conf/nginx.conf:117
3.5 安装nginx+lua时提示:./configure: error: ngx_http_lua_module requires the Lua library.
上回在安装nginx+lua时过程中,在执行./configure命令时提示错误: error: ngx_http_lua_module requires the Lua library,而我确实已经安装luajit(LuaJIT:LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language. lua的高效率版本)。在执行.configure时也导入了export LUAJIT_LIB和export LUAJIT_INC的目录路径。如下:
#Install nginx by 2019-12-12 yum -y install gcc gcc-c++ autoconf automake yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel useradd -s /sbin/nologin -M nginx cd /usr/local/src wget http://nginx.org/download/nginx-1.14.2.tar.gz wget http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz wget https://github.com/openresty/lua-nginx-module/archive/v0.10.14.tar.gz wget http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz\ git clone git://github.com/yzprofile/ngx_http_dyups_module.git tar zxf v0.3.0.tar.gz tar zxf LuaJIT-2.1.0-beta3.tar.gz tar zxf v0.10.14.tar.gz tar zxf nginx-1.14.2.tar.gz yum -y install lua-devel cd LuaJIT-2.1.0-beta3 make && make install cd .. cd nginx-1.14.2 ./configure --prefix=/usr/local/nginx --sbin-path=/usr/bin/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-pcre --with-http_stub_status_module --with-http_addition_module --with-http_gzip_static_module --with-file-aio --with-http_dav_module --add-module=../ngx_devel_kit-0.3.0 --add-module=../lua-nginx-module-0.10.14 --add-module=../ngx_http_dyups_module make make install
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@lua src]# ll total 3520 -rw-r--r-- 1 root root 1213 Dec 12 17:12 install-nginx.sh drwxr-xr-x 6 nginx nginx 100 May 2 2017 LuaJIT-2.1.0-beta3 -rw-r--r-- 1 root root 1025180 May 2 2017 LuaJIT-2.1.0-beta3.tar.gz drwxrwxr-x 10 root root 225 Feb 24 2019 lua-nginx-module-0.10.14 -rw-r--r-- 1 root root 829900 Dec 12 17:23 lua-nginx-module-master.zip drwxr-xr-x 9 1001 1001 186 Dec 12 16:57 nginx-1.14.2 -rw-r--r-- 1 root root 1015384 Dec 4 2018 nginx-1.14.2.tar.gz drwxrwxr-x 9 root root 221 May 10 2016 ngx_devel_kit-0.3.0 drwxr-xr-x 4 root root 187 Dec 12 17:04 ngx_http_dyups_module -rw-r--r-- 1 root root 654097 Dec 12 16:56 v0.10.14.tar.gz -rw-r--r-- 1 root root 66455 Dec 12 16:56 v0.3.0.tar.gz
.configure执行是成功的,但是在进行make的时候遇到报错:ngx_http_lua_common.h:20:20: error: luajit.h: No such file or directory,详细报错内容如下:
1 2 3 4 5 6 7 8 9
In file included from ../lua-nginx-module-0.10.15/src/ngx_http_lua_script.h:11:0, from ../lua-nginx-module-0.10.15/src/ngx_http_lua_script.c:13: ../lua-nginx-module-0.10.14/src/ngx_http_lua_common.h:20:20: fatal error: luajit.h: No such file or directory #include <luajit.h> ^ compilation terminated. make[1]: *** [objs/addon/src/ngx_http_lua_script.o] Error 1 make[1]: Leaving directory `/usr/local/src/nginx-1.14.2' make: *** [build] Error 2
解决方法:把lib的路径写入/etc/profile中
1 2 3 4
# vim /etc/profile export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/user/local/include/luajit-2.1 # source /etc/profile
重新编译即可成功!
1 2 3 4 5 6 7 8 9 10 11
[root@lua src]# nginx nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory [root@lua src]# find / -name libluajit-5.1.so.2 /usr/local/lib/libluajit-5.1.so.2 [root@lua src]# ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2 [root@lua src]# nginx -V nginx version: nginx/1.14.2 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/bin/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-pcre --with-http_stub_status_module --with-http_addition_module --with-http_gzip_static_module --with-file-aio --with-http_dav_module --add-module=../ngx_devel_kit-0.3.0 --add-module=../lua-nginx-module-0.10.14 --add-module=../ngx_http_dyups_module
3.7 php安装zip扩展
1 2 3 4 5 6
wget http://pecl.php.net/get/zip-1.20.0.tgz tar -zxf zip-1.20.0.tgz cd zip-1.20.0 /usr/local/php/bin/phpize .configure --with-php-config=/usr/local/php/bin/php-config make && make install
在.configure的时候可能会遇到的问题:
1 2 3 4 5 6 7 8
问题: checking for libzip... not found configure: error: Please reinstall the libzip distribution