在VULTR VPS的centos 7.3 64位上解决configure提示没有可用编译器的问题 no acceptable C compiler

导语:在VULTR VPS的centos 7.3 64位上,为客户编译php7的memcached,结果出现错误提示no acceptable C compiler。VULTR VPS的centos系统使用最小模式安装,导致很多包都没有,那么这个错误只要装GCC编译器就可以了。

错误提示

叶子准备为客户安装memcached来提高web服务器的性能,在编译memcached的php客户端的时候,出现no acceptable C compiler的错误。错误提示如下:

# ./configure --with-libmemcached-dir=/usr --with-php-config=/opt/lampp/bin/php-config --disable-memcached-sasl
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/usr/local/src/php-memcached':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

在VULTR VPS的centos 7.3 64位上解决configure提示没有可用编译器的问题 no acceptable C compiler

gcc安装

解决方法

使用下面的yum命令来安装gcc即可解决这个错误,注意,你的服务器必须是连通网络的。

yum -y install gcc

在VULTR VPS的centos 7.3 64位上解决configure提示没有可用编译器的问题 no acceptable C compiler

gcc安装

gcc依赖这些包:cpp、glibc-devel、glibc-headers、kernel-headers、libmpc、mpfr。依赖的包会被一起安装。安装成功后,会提示哪些包被安装了。

Installed:
  gcc.x86_64 0:4.8.5-11.el7

Dependency Installed:
  cpp.x86_64 0:4.8.5-11.el7       glibc-devel.x86_64 0:2.17-157.el7_3.1     glibc-headers.x86_64 0:2.17-157.el7_3.1     kernel-headers.x86_64 0:3.10.0-514.2.2.el7
  libmpc.x86_64 0:1.0.1-3.el7     mpfr.x86_64 0:3.1.1-4.el7

在VULTR VPS的centos 7.3 64位上解决configure提示没有可用编译器的问题 no acceptable C compiler

gcc安装

结束

你学会了吗?gcc编译器在centos上还是必须的,因为我们有可能会安装一些C的源码,需要使用gcc来编译。有很多包可以使用yum安装,前提是你使用CENTOS,连通网络。

发表评论

邮箱地址不会被公开。 必填项已用*标注