无法安装 PHP PDO

无法安装 PHP PDO

我现在已经尝试在 2 小时内安装 PHP PDO,但没有成功,并且我到处搜索解决方案 - 但没有任何成功。

yum install php-pdo 

不起作用,而且我在 php.ini 中找不到扩展名 = PDO。

已尝试更新

yum update

并清理它,没有任何效果。该怎么办?

我有 CentOS 6.4 版本(最终版)

  -bash-4.1# rpm -e rpmfusion-free-release rpmfusion-nonfree-release
  -bash-4.1# yum install php-pdo
  Loaded plugins: fastestmirror
  Loading mirror speeds from cached hostfile
   * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
   * rpmforge: mirror.jgotteswinter.com
   * updates: mirror.checkdomain.de
  Setting up Install Process
  No package php-pdo available.
  Error: Nothing to do
  -bash-4.1# yum clean
  Loaded plugins: fastestmirror
  Error: clean requires an option: headers, packages, metadata, dbcache, plugins,       expire-      cache, rpmdb, all
  -bash-4.1# yum update
  Loaded plugins: fastestmirror
  Loading mirror speeds from cached hostfile
   * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
   * rpmforge: mirror.jgotteswinter.com
   * updates: mirror.checkdomain.de
  Setting up Update Process
  No Packages marked for Update
  -bash-4.1# yum install php-pdo
  Loaded plugins: fastestmirror
  Loading mirror speeds from cached hostfile
   * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
   * rpmforge: mirror.jgotteswinter.com
   * updates: mirror.checkdomain.de
  Setting up Install Process
  No package php-pdo available.
  Error: Nothing to do
  -bash-4.1# su -c 'yum localinstall --nogpgcheck       http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E       %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-      $(rpm -E %fedora).noarch.rpm'
  Loaded plugins: fastestmirror
  Setting up Local Package Process
  Cannot open: http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-      %fedora.noarch.rpm. Skipping.
  Cannot open: http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-      %fedora.noarch.rpm. Skipping.
  Nothing to do
  -bash-4.1# su -c 'rpm -Uvh http://download1.rpmfusion.org/free/el/updates/5/i386/rpmfusion-      free-release-5-1.noarch.rpm       ttp://download1.rpmfusion.org/nonfree/el/updates/5/i386/rpmfusion-nonfree-release-5-      1.noarch.rpm'
  Retrieving http://download1.rpmfusion.org/free/el/updates/5/i386/rpmfusion-free-release-5-1.noarch.rpm
  warning: /var/tmp/rpm-tmp.d5nTQs: Header V3 DSA/SHA1 Signature, key ID e74f0522: NOKEY
  error: open of ttp://download1.rpmfusion.org/nonfree/el/updates/5/i386/rpmfusion-nonfree-      release-5-1.noarch.rpm failed: No such file or directory
  -bash-4.1# su -c 'yum localinstall --nogpgcheck       http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm       http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-      1.noarch.rpm'
  Loaded plugins: fastestmirror
  Setting up Local Package Process
  rpmfusion-free-release-6-1.noarch.rpm                    | 5.9 kB     00:00     
  Examining /var/tmp/yum-root-ch9z50/rpmfusion-free-release-6-1.noarch.rpm: rpmfusion-      free-release-6-1.noarch
  Marking /var/tmp/yum-root-ch9z50/rpmfusion-free-release-6-1.noarch.rpm to be installed
  Loading mirror speeds from cached hostfile
   * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
   * rpmforge: mirror.jgotteswinter.com
   * updates: mirror.checkdomain.de
  rpmfusion-nonfree-release-6-1.noarch.rpm                 | 6.0 kB     00:00     
  Examining /var/tmp/yum-root-ch9z50/rpmfusion-nonfree-release-6-1.noarch.rpm:       rpmfusion-nonfree-release-6-1.noarch
  Marking /var/tmp/yum-root-ch9z50/rpmfusion-nonfree-release-6-1.noarch.rpm to be installed
  Resolving Dependencies
  --> Running transaction check
  ---> Package rpmfusion-free-release.noarch 0:6-1 will be installed
  ---> Package rpmfusion-nonfree-release.noarch 0:6-1 will be installed
  --> Finished Dependency Resolution

  Dependencies Resolved

  ================================================================================
   Package                 Arch   Version
                                      Repository                             Size
  ================================================================================
  Installing:
   rpmfusion-free-release  noarch 6-1 /rpmfusion-free-release-6-1.noarch    3.7 k
   rpmfusion-nonfree-release
                           noarch 6-1 /rpmfusion-nonfree-release-6-1.noarch 3.8 k

  Transaction Summary
  ================================================================================
  Install       2 Package(s)

  Total size: 7.5 k
  Installed size: 7.5 k
  Is this ok [y/N]: y
  Downloading Packages:
  Running rpm_check_debug
  Running Transaction Test
  Transaction Test Succeeded
        Running Transaction
    Installing : rpmfusion-free-release-6-1.noarch                            1/2 
    Installing : rpmfusion-nonfree-release-6-1.noarch                         2/2 
    Verifying  : rpmfusion-nonfree-release-6-1.noarch                         1/2 
    Verifying  : rpmfusion-free-release-6-1.noarch                            2/2 

  Installed:
    rpmfusion-free-release.noarch 0:6-1   rpmfusion-nonfree-release.noarch 0:6-1  

  Complete!
  -bash-4.1# yum updateLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile       * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
   * rpmforge: mirror.jgotteswinter.com
   * rpmfusion-free-updates: ftp-stud.hs-esslingen.de
   * rpmfusion-nonfree-updates: ftp-stud.hs-esslingen.de
   * updates: mirror.checkdomain.de
  rpmfusion-free-updates                                   | 2.7 kB     00:00     
  rpmfusion-free-updates/primary_db                        | 247 kB     00:00     
  rpmfusion-nonfree-updates                                | 2.2 kB     00:00     
  rpmfusion-nonfree-updates/primary_db                     |  46 kB     00:00     
  Setting up Update Process
  No Packages marked for Update
  -bash-4.1# yum install php-pdoLoaded plugins: fastestmirrorLoading mirror speeds from cached       hostfile * base: mirror.checkdomain.de
   * epel: mirrors.n-ix.net
   * extras: mirror.checkdomain.de
         * rpmforge: mirror.jgotteswinter.com
   * rpmfusion-free-updates: ftp-stud.hs-esslingen.de
   * rpmfusion-nonfree-updates: ftp-stud.hs-esslingen.de
   * updates: mirror.checkdomain.de
  Setting up Install Process
  No package php-pdo available.
  E      rror: Nothing to do
  -bash-4.1# /etc/yum.conf
  -bash: /etc/yum.conf: Permission denied
  -bash-4.1# 

答案1

您似乎已为 Fedora 而非 Enterprise Linux 安装了 RPM Fusion 存储库。这些存储库与您的 CentOS 系统不兼容,因此会导致此错误。

要解决该问题,请删除 repos(例如rpm -e rpmfusion-free-release rpmfusion-nonfree-release)和用正确的存储库替换它们

然后,检查您的/etc/yum.conf文件并删除任何不适当的exclude内容。

(错误 503 是暂时的故障,当上游修复其网站时它将自行解决。您现在可以忽略它。)

答案2

您的服务器是否位于代理或防火墙后面?尝试获取时出现 503 错误:

https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64

表明你的服务器无法下载镜像列表。

由于无法获取镜像列表,它将无法找到所需的 RPM。

您可能想看看是否可以使用 curl 获取该 URL:

curl "https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64"

如果您可以删除添加的存储库以恢复标准配置。

相关内容