首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用PHP7.2扩展Debian 9:无法安装PDO PHP扩展

使用PHP7.2扩展Debian 9:无法安装PDO PHP扩展
EN

Server Fault用户
提问于 2018-12-19 15:21:14
回答 1查看 12.4K关注 0票数 1

我在Debian 9服务器(实际上是一个码头容器)上安装了PHP7.2,并安装了一些PHP模块。

但是,当我到达gdpdo/mysql apt时,无法找到任何包:

代码语言:javascript
复制
$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文件如下所示:

代码语言:javascript
复制
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上运行的软件有以下要求:

  • PDO PHP扩展

注意php7.2-mysql也有同样的问题

代码语言:javascript
复制
$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命令之后):

代码语言:javascript
复制
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.
EN

回答 1

Server Fault用户

发布于 2018-12-22 13:34:46

没有这样的包,因为PDO嵌入到提供SQL模块的包中:

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/945980

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档