![CentOS 上的 Memcache 构建错误](https://linux22.com/image/709698/CentOS%20%E4%B8%8A%E7%9A%84%20Memcache%20%E6%9E%84%E5%BB%BA%E9%94%99%E8%AF%AF.png)
我在 Centos 7 上安装“Pterodactyl Panel”时遇到问题。我卡在“pecl install memcache”这一行。错误显示如下:
[root@localhost ~]# pecl install memcache
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading memcache-2.2.7.tgz ...
Starting to download memcache-2.2.7.tgz (36,459 bytes)
..........done: 36,459 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
Enable memcache session handler support? [yes] : y
building in /var/tmp/pear-build-rootEloe5R/memcache-2.2.7
running: /var/tmp/memcache/configure --with-php-config=/usr/bin/php-config --enable-memcache-session=y
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 `/var/tmp/pear-build-rootEloe5R/memcache-2.2.7':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: `/var/tmp/memcache/configure --with-php-config=/usr/bin/php-config --enable-memcache-session=y' failed
[root@localhost ~]# configure: error: in `/var/tmp/pear-build-rootEloe5R/memcache-2.2.7'
这是一台新格式化的Centos 7 VPS。我从教程的开头开始安装“翼手龙面板”。
这些是我在到达这一点之前执行的命令:
yum install -y epel-release https://centos7.iuscommunity.org/ius-release.rpm
yum update -y
yum install -y httpd openssl-devel php71u php71u-common php71u-fpm php71u-cli php71u-json php71u-mysqlnd php71u-mcrypt php71u-gd php71u-mbstring php71u-pdo php71u-zip php71u-bcmath php71u-dom php71u-opcache php71u-devel pecl php71u-devel pecl pear1u memcached
# Enable Memcached
systemctl enable memcached
systemctl start memcached
# Install PHP Module
pecl install memcache
答案1
这是错误
configure: error: no acceptable C compiler found in $PATH
您没有安装编译器
yum install gcc