vagrant

Nginx(二) nginx 无法启动

 

有时候在客户端输入:nginx

但是终端会输出以下,显示启动失败

1
2
3
4
5
6
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
nginx: [emerg] still could not bind()

这时候可以输入:ps -ef| grep nginx

 终端会输出以下,显示占用的端口

1
2
3
0   551     1   0  9:22PM ??         0:00.01 nginx: master process nginx
-2   614   551   0  9:26PM ??         0:00.00 nginx: worker process
 0   618   606   0  9:27PM ttys000    0:00.00 grep nginx

然后输入:kill 551

来停止该端口进程。

再在终端输入:nginx

然后在浏览器输入:http://127.0.0.1:8080/

就会显示启动正常。

make 命令出现:"make:*** No targets specified and no makefile found.Stop."
原创shun35 最后发布于2019-07-03 16:57:58 阅读数 14832 收藏
展开
我们在Linux 安装包的时候,使用make 命令出现:"make:*** No targets specified and no makefile found.Stop."这样的错误提示。

我们有三种方式可以尝试解决:

第一种:

第一、update最新版本系统软件

yum update

这个必须要执行后才可以安装我们的系统软件或者一键包。

第二、编译缺失关联软件

yum install gcc build-essential

编译执行完毕之后,我们在执行./configure && make这类的执行命令就可以解决问题。


第二种:

一、Linux下各种依赖都已经安装,是因为没有找到makefile。

如果是自己写的,确定在当前目录下;如果是源码安装,先运行./configure,生成makefile,再执行make,即可正常运行。

二、如果没有安装其他依赖先安装依赖

yum install gcc gcc-c++ autoconf automake

yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel (安装依赖zlib、openssl和pcre)

第一、update最新版本系统软件

apt-get update

这个必须要执行后才可以安装我们的系统软件或者一键包。

第二、编译缺失关联软件

apt-get install gcc build-essential

编译执行完毕之后,我们在执行./configure && make这类的执行命令就可以解决问题。


补充二:可能是因为没有安装gcc     是用来编译c程序 c++程序的,  

yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-develfreetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-develglib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devele2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel opensslopenssl-devel openldap openldap-devel nss_ldap openldap-clientsopenldap-servers


补充三:


wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
tar zxvf ncurses-5.6.tar.gz
 ./configure -prefix=/usr/local -with-shared -without-debug
make
make install 

 

使用如下命令来验正(如果此命令输出有中几个php-fpm进程就说明启动成功了):

1
ps aux | grep php-fpm

 

posted @ 2020-03-19 21:12  胡良庆  阅读(126)  评论(0编辑  收藏  举报