我在 CentOS 上安装了 php 5.5(据我所知,来自 Remi 存储库)。
现在我想打开opcache并对其进行配置,但事实证明我在系统中没有 opcache.so 文件。所以我尝试用 yum 安装它。
# yum --enablerepo=remi install php-pecl-zendopcache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.proserve.nl
* epel: mirror.proserve.nl
* extras: ftp.tudelft.nl
* remi: remi.mirrors.hostinginnederland.nl
* rpmforge: nl.mirror.eurid.eu
* updates: mirror.proserve.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-zendopcache.x86_64 0:7.0.2-2.el6.remi will be installed
--> Processing Dependency: php(zend-abi) = 20100525-x86-64 for package: php-pecl-zendopcache-7.0.2-2.el6.remi.x86_64
--> Processing Dependency: php(api) = 20100412-x86-64 for package: php-pecl-zendopcache-7.0.2-2.el6.remi.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-zendopcache-7.0.2-2.el6.remi.x86_64 (remi)
Requires: php(api) = 20100412-x86-64
Installed: php-common-5.5.5-2.el6.remi.x86_64 (@remi-php55)
php(api) = 20121113-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
Available: php-common-5.4.21-1.el6.remi.x86_64 (remi)
php(api) = 20100412-x86-64
Available: php-common-5.4.21-2.el6.remi.x86_64 (remi)
php(api) = 20100412-x86-64
Error: Package: php-pecl-zendopcache-7.0.2-2.el6.remi.x86_64 (remi)
Requires: php(zend-abi) = 20100525-x86-64
Installed: php-common-5.5.5-2.el6.remi.x86_64 (@remi-php55)
php(zend-abi) = 20121212-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
Available: php-common-5.4.21-1.el6.remi.x86_64 (remi)
php(zend-abi) = 20100525-x86-64
Available: php-common-5.4.21-2.el6.remi.x86_64 (remi)
php(zend-abi) = 20100525-x86-64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
如果我安装了较新版本的 php 并且无法正确解决依赖项,如何处理此问题?
哦,我已经得到了问题的答案:)把它加在这里,也许,其他人会使用它。
最初我使用这样的命令安装了 php
# yum --enablerepo=remi,remi-php55 install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
现在我只是用这个命令添加了缺少的扩展名
# yum --enablerepo=remi,remi-php55 install php-opcache
它奏效了!!phpinfo() 显示了所需的模块:)
我在安装 php-mcrypt 时遇到了类似的问题,我使用了以下命令:
sudo yum --enablerepo=remi,remi-php56 install php-mcrypt