如何在 CentOS 6 和 Nginx 上安装 Xcache?

如何在 CentOS 6 和 Nginx 上安装 Xcache?

我买了一个新的 VPS,但我不是 Linux 极客。我已经在 CentOS 6 上安装了 LEMP 堆栈。我刚刚尝试在我的 VPS 上安装 Xcache。我使用以下命令安装 Xcache,但它显示错误。

我用来安装 Xcache 的命令

yum install php-xcache xcache-admin

我得到的错误是:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.san.fastserv.com
 * epel: mirrors.kernel.org
 * extras: mirror.pac-12.org
 * updates: mirrors.easynews.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-xcache.x86_64 0:3.0.2-1.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
---> Package xcache-admin.noarch 0:3.0.2-1.el6 will be installed
--> Processing Dependency: mod_php for package: xcache-admin-3.0.2-1.el6.noarch
--> Processing Dependency: httpd for package: xcache-admin-3.0.2-1.el6.noarch
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be installed
---> Package php.x86_64 0:5.3.3-23.el6_4 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-5.3.3-23.el6_4.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.3-23.el6_4 for package: php-5.3.3-23.el6_4.x86_64
---> Package php-xcache.x86_64 0:3.0.2-1.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
--> Running transaction check
---> Package php.x86_64 0:5.3.3-23.el6_4 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-5.3.3-23.el6_4.x86_64
---> Package php-cli.x86_64 0:5.3.3-23.el6_4 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-cli-5.3.3-23.el6_4.x86_64
---> Package php-xcache.x86_64 0:3.0.2-1.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-xcache-3.0.2-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: php-xcache-3.0.2-1.el6.x86_64 (epel)
           Requires: php(api) = 20090626
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php(api) = 20100412-x86-64
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php(api) = 20090626
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php(api) = 20090626
Error: Package: php-xcache-3.0.2-1.el6.x86_64 (epel)
           Requires: php(zend-abi) = 20090626
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php(zend-abi) = 20100525-x86-64
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php(zend-abi) = 20090626
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php(zend-abi) = 20090626
Error: Package: php-cli-5.3.3-23.el6_4.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-23.el6_4
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.17-2.el6.remi
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-22.el6
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php-common(x86-64) = 5.3.3-23.el6_4
Error: Package: php-5.3.3-23.el6_4.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-23.el6_4
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.17-2.el6.remi
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-22.el6
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php-common(x86-64) = 5.3.3-23.el6_4
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

请帮我如何在我的 VPS 上安装 Xcache。

答案1

我认为错误信息非常清楚:

Error: Package: php-xcache-3.0.2-1.el6.x86_64 (epel)
           Requires: php(api) = 20090626
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php(api) = 20100412-x86-64

由于您已经使用 Remi 存储库安装php-5.4.17-2.el6.remi.x86_64,你应该安装他的php-xcache-3.0.3-1.el6.remi.x86_64包,而不是 EPEL 的包,正如错误消息所解释的,它依赖于较低的 PHP 版本。

答案2

问题解决了

我的问题:我在配置我的新 VPS 时遇到错误。我发现我试图使用 EPEL 的存储库在我的 VPS 上安装 Xcache。我现在使用 RPM 的存储库安装了 Xcache。整个问题都是因为我使用 RPM 的存储库安装php-5.4.17-2.el6.remi.x86_64。由于我使用 RPM 的 repo 安装 php,因此我需要执行相同的操作来安装 Xcache。

下面是我在 CentOS 驱动的 VPS 上安装 Xcache 时使用的代码

rpm -Uvh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/php-xcache-3.0.3-1.el6.remi.x86_64.rpm

我从命令行收到以下响应:

Preparing...                ########################################### [100%]   
1:php-xcache-3.0.3-1.el6.remi.x86_64    ########################################### [100%]

最后,它现在可以工作了。

相关内容