nginx报错:./configure: error: C compiler cc is not found,
时间: 2023-08-02 13:05:54 浏览: 153
这个错误提示是因为编译 Nginx 时找不到 C 编译器。你需要安装一个 C 编译器,比如 GCC 或 Clang。
如果你使用的是 Ubuntu 或 Debian 等基于 apt 的系统,可以使用以下命令安装 GCC:
```
sudo apt-get update
sudo apt-get install build-essential
```
如果你使用的是 CentOS 或 Fedora 等基于 yum 的系统,可以使用以下命令安装 GCC:
```
sudo yum groupinstall "Development Tools"
```
安装完 C 编译器后,重新运行 Nginx 的 configure 脚本即可。
相关问题
nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的
这个错误提示说明在编译 Nginx 时,找不到 C 编译器。可以尝试以下几个步骤:
1. 确认 gcc 已经正确安装。可以使用 `gcc -v` 命令查看版本信息。
2. 如果 gcc 已经安装,可以尝试更新软件包列表并重新安装 C 编译器:
```
sudo apt update
sudo apt install build-essential
```
`build-essential` 包包含了编译 C 语言程序所需的基本组件,包括 gcc 编译器。
3. 如果上述方法还是无法解决问题,可以尝试手动设置编译器路径。在执行 configure 命令时,指定 C 编译器的路径:
```
./configure --with-cc=/usr/bin/gcc
```
这里的 `/usr/bin/gcc` 是 gcc 编译器的安装路径,可以根据实际情况进行修改。
ubuntu安装 nginx报错 ./configure: error: C compiler cc is not found
在Ubuntu上安装Nginx时,如果出现"./configure: error: C compiler cc is not found"的错误提示,这通常是由于缺少C编译器导致的。解决这个问题的方法是安装C编译器。
你可以通过以下步骤来安装C编译器:
1. 打开终端,使用以下命令更新软件包列表:
```
sudo apt update
```
2. 安装C编译器(gcc)和make工具:
```
sudo apt install build-essential
```
3. 安装完成后,再次尝试安装Nginx,应该不再出现C编译器未找到的错误。