php - 无法在 Centos 上安装 php-ZendFramework-Db-Adapter-Pdo-Mysql

标签 php zend-framework centos yum

我在使用 Fedora 的个人笔记本电脑上完成了一个 zend 项目,并将其转移到在 CentOs 发行版上运行的官方服务器。当我运行它时,我遇到了与 Fedora 相同的问题,即:-

[Wed Jan 27 21:04:28 2016] PHP Warning:  include_once(Zend/Db/Adapter/Pdo/Mysql.php): failed to open stream: No such file or directory in /usr/share/php/Zend/Loader.php on line 134
[Wed Jan 27 21:04:28 2016] PHP Warning:  include_once(): Failed opening 'Zend/Db/Adapter/Pdo/Mysql.php' for inclusion (include_path='/var/www/inference_assist/application/../library:/var/www/inference_assist/library:.:/usr/share/pear:/usr/share/php') in /usr/share/php/Zend/Loader.php on line 134
[Wed Jan 27 21:04:28 2016] PHP Warning:  include_once(Zend/Db/Adapter/Pdo/Mysql.php): failed to open stream: No such file or directory in /usr/share/php/Zend/Loader.php on line 134
[Wed Jan 27 21:04:28 2016] PHP Warning:  include_once(): Failed opening 'Zend/Db/Adapter/Pdo/Mysql.php' for inclusion (include_path='/var/www/inference_assist/application/../library:/var/www/inference_assist/library:.:/usr/share/pear:/usr/share/php') in /usr/share/php/Zend/Loader.php on line 134
[Wed Jan 27 21:04:28 2016] PHP Fatal error:  Uncaught exception 'Zend_Exception' with message 'File "Zend/Db/Adapter/Pdo/Mysql.php" does not exist or class "Zend_Db_Adapter_Pdo_Mysql" was not found in the file' in /usr/share/php/Zend/Loader.php:87
Stack trace:
#0 /usr/share/php/Zend/Db.php(263): Zend_Loader::loadClass('Zend_Db_Adapter...')
#1 /usr/share/php/Zend/Application/Resource/Db.php(142): Zend_Db::factory('PDO_MYSQL', Array)
#2 /usr/share/php/Zend/Application/Resource/Db.php(160): Zend_Application_Resource_Db->getDbAdapter()
#3 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(695): Zend_Application_Resource_Db->init()
#4 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(638): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('db')
#5 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(598): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL)
#6 /usr/share/php/Zend/Application.php(373): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(NULL)
#7 /var/www/inference_assist/public/ in /usr/share/php/Zend/Loader.php on line 87

我已经使用这个答案(Missing /Zend/Db/Adapter/Pdo/Mysql.php)在 Fedora 中解决了这个问题

但是如果我在 CentO 上尝试同样的事情,我会收到以下错误:-
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.optus.net
 * epel: kdeforge2.unl.edu
 * extras: mirror.optus.net
 * remi-safe: remi.conetix.com.au
 * updates: centos.mirror.crucial.com.au
 * webtatic: sp.repo.webtatic.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch 0:1.12.3-1.el6 will be installed
--> Processing Dependency: php-ZendFramework-Db-Adapter-Pdo = 1.12.3-1.el6 for package: php-ZendFramework-Db-Adapter-Pdo-Mysql-1.12.3-1.el6.noarch
--> Processing Dependency: php-ZendFramework = 1.12.3-1.el6 for package: php-ZendFramework-Db-Adapter-Pdo-Mysql-1.12.3-1.el6.noarch
--> Running transaction check
---> Package php-ZendFramework-Db-Adapter-Pdo.noarch 0:1.12.3-1.el6 will be installed
--> Processing Dependency: php-ZendFramework = 1.12.3-1.el6 for package: php-ZendFramework-Db-Adapter-Pdo-1.12.3-1.el6.noarch
---> Package php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch 0:1.12.3-1.el6 will be installed
--> Processing Dependency: php-ZendFramework = 1.12.3-1.el6 for package: php-ZendFramework-Db-Adapter-Pdo-Mysql-1.12.3-1.el6.noarch
--> Finished Dependency Resolution
Error: Package: php-ZendFramework-Db-Adapter-Pdo-Mysql-1.12.3-1.el6.noarch (epel)
           Requires: php-ZendFramework = 1.12.3-1.el6
           Installed: php-ZendFramework-1.12.17-1.el6.remi.noarch (@remi)
               php-ZendFramework = 1.12.17-1.el6.remi
           Available: php-ZendFramework-1.12.3-1.el6.noarch (epel)
               php-ZendFramework = 1.12.3-1.el6
Error: Package: php-ZendFramework-Db-Adapter-Pdo-1.12.3-1.el6.noarch (epel)
           Requires: php-ZendFramework = 1.12.3-1.el6
           Installed: php-ZendFramework-1.12.17-1.el6.remi.noarch (@remi)
               php-ZendFramework = 1.12.17-1.el6.remi
           Available: php-ZendFramework-1.12.3-1.el6.noarch (epel)
               php-ZendFramework = 1.12.3-1.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我尝试使用 --skip-broken 来解决该问题,但无济于事,输入 rpm -Va --nofiles --nodigest 似乎什么也没做。

谁能提供上述错误的解决方案/解释?

最佳答案

经过几个小时的搜索和实验,我找到了答案:-
我不得不跑:-

yum --enablerepo=remi,remi-php54 install php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch

而不仅仅是: -
 yum install php-ZendFramework-Db-Adapter-Pdo-Mysql

感谢这个答案(https://stackoverflow.com/a/21935770/4064854)

关于php - 无法在 Centos 上安装 php-ZendFramework-Db-Adapter-Pdo-Mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35051833/

相关文章:

java - 通过 Post Android 发送数据到 PHP

zend-framework - 如何在 zend Controller 中自动加载单例类(私有(private)构造函数)?

php - Doctrine ArrayCollection 对 null 调用成员函数 setValue()

python - 为什么上传的图像权限取决于其大小?

PHP Mysql连接问题

PHP shell_exec 不适用于两个不同的应用程序版本

mysql - 将 mySQL 查询转换为 Zend FrameWork 查询的工具

Centos 6 yum 更新失败

node.js - 端口打开但连接被拒绝...centos 8/nginx/react/nodejs

javascript - 如何从 DOM 发送图像作为表单的一部分