我在Debian 9服务器(实际上是一个码头容器)上安装了PHP7.2,并安装了一些PHP模块。
但是,当我到达gd和pdo/mysql apt时,无法找到任何包:
$apt install php-pdo
Package php-pdo is a virtual package provided by:
php7.3-common 7.3.0-2 [Not candidate version]
php7.0-common 7.0.33-0+deb9u1 [Not candidate version]
php7.0-common 7.0.30-0+deb9u1 [Not candidate version]我的sources.list文件如下所示:
cat /etc/apt/sources.list
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb https://packages.sury.org/php/ stretch main
deb https://packages.sury.org/apache2/ stretch main我浏览了许多推荐不同内容的网站,其中很多网站建议添加ondrej/php PPA,我认为这只适用于Ubuntu系统。
PS:我试图在PHP上运行的软件有以下要求:
注意包php7.2-mysql也有同样的问题
$apt-get install php7.2-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-mysql
E: Couldn't find any package by glob 'php7.2-mysql'
E: Couldn't find any package by regex 'php7.2-mysql'Edit 2:这是apt-get update的输出(在清理缓存的apt-get clean命令之后):
apt-get update
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://repo.mysql.com/apt/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://security.debian.org/debian-security stretch/updates InRelease
Hit:5 http://security.debian.org/debian-security buster/updates InRelease
Ign:6 http://deb.debian.org/debian strecht InRelease
Hit:7 http://deb.debian.org/debian buster InRelease
Hit:8 http://deb.debian.org/debian buster-updates InRelease
Hit:9 http://deb.debian.org/debian stretch Release
Ign:10 http://deb.debian.org/debian strecht Release
Ign:11 http://deb.debian.org/debian strecht/main Sources
Ign:11 http://deb.debian.org/debian strecht/main Sources
Ign:11 http://deb.debian.org/debian strecht/main Sources
Ign:11 http://deb.debian.org/debian strecht/main Sources
Ign:11 http://deb.debian.org/debian strecht/main Sources
Err:11 http://deb.debian.org/debian strecht/main Sources
404 Not Found
Reading package lists... Done
W: The repository 'http://deb.debian.org/debian strecht Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://deb.debian.org/debian/dists/strecht/main/source/Sources 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.发布于 2018-12-22 13:34:46
没有这样的包,因为PDO嵌入到提供SQL模块的包中:
Package: php7.2-mysql
Description: MySQL module for PHP
This package provides the MySQL module(s) for PHP.
Provides: php-mysqli, php-mysqlnd, php-pdo-mysql,
php7.2-mysqli, php7.2-mysqlnd, php7.2-pdo-mysql
Package: php7.2-pgsql
Description: PostgreSQL module for PHP
This package provides the PostgreSQL module(s) for PHP.
Provides: php-pdo-pgsql, php-pgsql, php7.2-pdo-pgsql还需要注意的是,这些不是Debian 9拉伸版的包,只有有 PHP7.0。它们来自您添加的Sury.org存储库deb https://packages.sury.org/php/ stretch main。
https://serverfault.com/questions/945980
复制相似问题