你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

Ubuntu20.04 E: Unable to locate package php5.6-dev

2021-11-22 11:06:03

这个问题是安装swoole的时候遇到的,下面是场景复现:

按官方推荐pecl安装:

pecl install swoole

会报错:

root@de7906a737ea:/home/laravelS# pecl install swoole
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading swoole-4.8.2.tgz ...
Starting to download swoole-4.8.2.tgz (1,845,021 bytes)
............................................................................................................................................................................................................................................................................................................................................................................done: 1,845,021 bytes
416 source files, building
running: phpize
sh: 1: phpize: not found
ERROR: `phpize' failed

然后度娘说要安装php5.6-dev:

apt-get install php5.6-dev

又报错:

root@de7906a737ea:/home/laravelS# apt-get install php5.6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5.6-dev
E: Couldn't find any package by glob 'php5.6-dev'
E: Couldn't find any package by regex 'php5.6-dev'

提示没有这个安装包;

解决:

替换命令为:

apt-get install php-dev

安装完后再执行:

pecl install swoole

完美解决