When installing nginx, make compile is not possible, error make: *** no target specified and makefile cannot be found.

The installation of nginx is a little more complicated. I just installed nginx today and found a bunch of problems, in which an error was reported ** make: *** did not specify the target and the makefile could not be found. Stop, let me talk about the solution


My environment
1, centOS7
2, nginx-1.10.2

When installing nginx-1.10.2, I executed the ./configure --prefix=/usr/local/nginx command and found that the error make: *** did not specify the target and the makefile could not be found, so I found many ways to solve it. , And finally found a problem with the dependent library.
First install the dependent library
(1) gcc

To install nginx, you need to compile the source code downloaded from the official website. The compilation depends on the gcc environment. If there is no gcc environment, you need to install it.

    yum install gcc-c++
1
(2) PCRE

PCRE (Perl Compatible Regular Expressions) is a Perl library, including Perl compatible regular expression libraries. The http module of nginx uses pcre to parse regular expressions, so the pcre library needs to be installed on linux.

    yum install -y pcre pcre-devel
1
Note: pcre-devel is a secondary development library developed using pcre. Nginx also needs this library.

(3) zlib

The zlib library provides many ways to compress and decompress. Nginx uses zlib to gzip the content of the http package, so you need to install the zlib library on Linux.

    yum install -y zlib zlib-devel
1
(4) openssl

OpenSSL is a powerful secure socket layer cryptographic library, including the main cryptographic algorithms, commonly used key and certificate packaging management functions and SSL protocols, and provides a wealth of applications for testing or other purposes.

Nginx not only supports the http protocol, but also supports https (that is, HTTP is transmitted over the ssl protocol), so you need to install the openssl library in Linux.

    yum install -y openssl openssl-devel
1
Attention! ! ! : Because I used the command yum install pcre to install the pcre library once, and found it could not be used! Still the same will report make: *** No target is specified and makefile cannot be found, so I manually downloaded a source package to install, the details are as follows

Download: wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
Unzip pcre-8.40.tar.gz

    tar zxvf pcre-8.40.tar.gz
1
enter cd pcre-7.7

After the installation is complete, run ./configure as follows


Try the make command again

Found that it can be used to
complete, successful
————————————————
Copyright statement: This article is the original article of the CSDN blogger "Do you have a headache", follow the CC 4.0 BY-SA copyright agreement, reproduced Please attach a link to the original source and this statement.
Original link: https://blog.csdn.net/weixin_42896137/article/details/88660621

Guess you like

Origin blog.csdn.net/kakak2000/article/details/105735630