magento前台访问错误 - Class name must be a valid object or a string

1.magento 1.x 版本,站点搬迁后,前台访问,提示错误:Fatal error: Class name must be a valid object or a string in /www/users/domain.name/includes/src/__default.php on line 29658

2.查看 __default.php 相应的行,大概有如下:

    public function getConnectionTypeInstance($type)
    {
        if (!isset($this->_connectionTypes[$type])) {
            $config = Mage::getConfig()->getResourceTypeConfig($type);
            $typeClass = $config->getClassName();
            $this->_connectionTypes[$type] = new $typeClass();
        }
        return $this->_connectionTypes[$type];
    }

3.网上查得,这是mysql连接相关。查看 local.xml 文件中mysql的配置内容,是写了 pdo_mysqli ,但查看当前的php模块中,仅有 pdo_mysql
mag-pdo_mysql-1.png

4.将 local.xml 文件中的 pdo_mysqli 替换为 pdo_mysql 后,就正常了
mag-pdo_mysql-2.png

参考:https://stackoverflow.com/questions/13377491/magento-fatal-error-class-name-must-be-a-valid-object-or-a-string

标签: magento

添加新评论