安装swoole第一步就卡住了,报错:bash: pecl: command not found请问如何解决?

[[email protected] ~]# php -v
PHP 7.1.3 (cli) (built: Apr 2 2018 16:12:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies

[[email protected] ~]# pecl install swoole
-bash: pecl: command not found
[[email protected] ~]#

我通过百度安装pecl,
yum install php-devel php-pear

这个一路下来,安装的是rpm 有pecl,而且还有PHP5.4。然后再安装swoole一直就提示版本,不行,因为他用的是PHP5.4的pecl.

请问PHP7.1如何安装pecl?

最佳答案

你PHP怎么安装的?

  • 如果是ubuntu,执行apt-get install php-dev
  • 如果是yum,执行yum install php-devel