gpt4 book ai didi

magento - Magento 中/app/code/core/Mage/Core/Model/Resource/Resource.php 发生 fatal error

转载 作者:行者123 更新时间:2023-12-02 10:28:53 27 4
gpt4 key购买 nike

刚刚将 Magento 安装从 1.5 升级到 1.6,并出现以下错误:

Fatal error: Call to a member function insert() on a non-object in /hsphere/local/home/t21004/XXXXXXXXXXXXX.com/app/code/core/Mage/Core/Model/Resource/Resource.php on line 133

第133行内容如下:

 return $this->_getWriteAdapter()->insert($this->getMainTable(), $dbModuleInfo);
<小时/>

配置.xml:

    <?xml version="1.0"?>
<!--
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Core
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
-->
<config>
<global>
<install>
<date/>
</install>
<resources>
<default_setup>
<connection>
<host>localhost</host>
<username/>
<password/>
<dbname>magento</dbname>
<model>mysql4</model>
<initStatements>SET NAMES utf8</initStatements>
<type>pdo_mysql</type>
<active>0</active>
</connection>
</default_setup>
<default_write>
<connection>
<use>default_setup</use>
</connection>
</default_write>
<default_read>
<connection>
<use>default_setup</use>
</connection>
</default_read>
<core_setup>
<setup>
<module>Mage_Core</module>
</setup>
<connection>
<use>default_setup</use>
</connection>
</core_setup>
<core_write>
<connection>
<use>default_write</use>
</connection>
</core_write>
<core_read>
<connection>
<use>default_read</use>
</connection>
</core_read>
</resources>
<resource>
<connection>
<types>
<pdo_mysql>
<adapter>Varien_Db_Adapter_Pdo_Mysql</adapter>
<class>Mage_Core_Model_Resource_Type_Db_Pdo_Mysql</class>
<compatibleMode>1</compatibleMode>
</pdo_mysql>
</types>
</connection>
</resource>
<models>
<varien>
<class>Varien</class>
</varien>
<core>
<class>Mage_Core_Model</class>
<resourceModel>core_resource</resourceModel>
</core>
<core_resource>
<class>Mage_Core_Model_Resource</class>
<deprecatedNode>core_mysql4</deprecatedNode>
<entities>
<config_data>
<table>core_config_data</table>
</config_data>
<website>
<table>core_website</table>
</website>
<store>
<table>core_store</table>
</store>
<resource>
<table>core_resource</table>
</resource>
<cache>
<table>core_cache</table>
</cache>
<cache_tag>
<table>core_cache_tag</table>
</cache_tag>
<cache_option>
<table>core_cache_option</table>
</cache_option>
</entities>
</core_resource>
</models>
</global>
<default>
<system>
<filesystem>
<base>{{root_dir}}</base>
<app>{{root_dir}}/app</app>
<code>{{app_dir}}/code</code>
<design>{{app_dir}}/design</design>
<locale>{{app_dir}}/locale</locale>
<etc>{{app_dir}}/etc</etc>
<media>{{root_dir}}/media</media>
<upload>{{root_dir}}/media/upload</upload>
<skin>{{root_dir}}/skin</skin>
<var>{{var_dir}}</var>
<cache>{{var_dir}}/cache</cache>
<session>{{var_dir}}/session</session>
<tmp>{{var_dir}}/tmp</tmp>
<pear>{{var_dir}}/pear</pear>
<export>{{var_dir}}/export</export>
</filesystem>
</system>
<general>
<locale>
<code>en_US</code>
<timezone>America/Los_Angeles</timezone>
</locale>
</general>
</default>
<varien>
<class>Varien</class>
</varien>
</config>

和 local.xml :

<?xml version="1.0"?>
<!--
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Core
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
-->
<config>
<global>
<install>
<date><![CDATA[Tue, 26 Apr 2011 15:59:54 +0000]]></date>
</install>
<crypt>
<key><![CDATA[XXXXXXXXXXXXXXXXXXXXXXXXXXXX]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[XXXXXXXXX]]></host>
<username><![CDATA[XXXXXXXXXX]]></username>
<password><![CDATA[XXXXXXXXXX]]></password>
<dbname><![CDATA[XXXXXXX]]></dbname>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
</config>

最佳答案

此错误归结为配置问题。安装模型尝试安装/升级安装中的某些模块,但在找不到资源的写入连接时失败。这似乎表明两个位置之一的配置已损坏:全局配置(/app/etc/*.xml)或特定模块配置(模块中的etc/config.xml)。

问题模块可能有一个配置节/config/global/resources,其中包含对设置/读/写连接的引用。检查情况是否如此,以及写入连接的引用是否正确。如果不是特定模块,请检查全局资源 core_(read|write|setup) 和 default_(read|write|setup) 是否正确。

关于magento - Magento 中/app/code/core/Mage/Core/Model/Resource/Resource.php 发生 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7190461/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com