【问题标题】:500 error after configuration page, setting up magento with substore配置页面后出现 500 错误,使用子存储设置 magento
【发布时间】:2012-08-31 11:30:53
【问题描述】:

我已经创建了一个工作 magento 站点现在我正在尝试基于现有工作站点创建一个测试环境。它在同一台服务器上,将在不同的子域下。

workingSubDomain.domain.com/store/ newSubDomain.domain.com/store/

我保持子存储目录结构与工作站点相同。

我已经将所有文件夹设置为 755,并将 app/etc/、media、var 设置为 777

在安装向导配置页面上单击继续后,我收到 500 错误。

服务器日志文件显示如下:

PHP Fatal error: Call to a member function insert() on a non-object in /var/www/vhosts/domain.com/magentoFolder/subStore/app/code/core/Mage/Core/Model/Resource/Resource.php on line 133, referer: http://newSubDomain.domain.com/subStore/index.php/install/wizard/config/?config%5Blocale%5D=en_US&config%5Btimezone%5D=America%2FChicago&config%5Bcurrency%5D=USD

我在 .htaccess 文件夹中尝试了以下 url 重写:

RewriteEngine On
RewriteBase /clint/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /clint/index.php [L]

RewriteBase /magentoFolder/subStore

RewriteBase /magentoFolder/subStore/

RewriteBase /magentoFolder/

RewriteBase /subStore/

我也清除了 var 文件夹。

任何建议将不胜感激。

这是resource.php文件第133行的代码:

 * Set module version into DB
 *
 * @param string $resName
 * @param string $version
 * @return int
 */
public function setDbVersion($resName, $version)
{
    $dbModuleInfo = array(
        'code'    => $resName,
        'version' => $version,
    );

    if ($this->getDbVersion($resName)) {
        self::$_versions[$resName] = $version;
        return $this->_getWriteAdapter()->update($this->getMainTable(),
                $dbModuleInfo,
                array('code = ?' => $resName));
    } else {
        self::$_versions[$resName] = $version;
        return $this->_getWriteAdapter()->insert($this->getMainTable(), $dbModuleInfo);
    }
}

【问题讨论】:

    标签: .htaccess magento installation


    【解决方案1】:

    这不是 apache 错误,而是 php 错误。看看/var/www/vhosts/domain.com/magentoFolder/subStore/app/code/core/Mage/Core/Model/Resource/Resource.php133

    可能是数据库连接错误。

    【讨论】:

    • 我继续看下去。我正在经历 Magento 安装过程,该过程应该构建 local.xml 文件。该文件将具有连接设置。我只是使用 localhost 作为主机值
    猜你喜欢
    • 1970-01-01
    • 2013-04-18
    • 2020-06-14
    • 2012-10-24
    • 1970-01-01
    • 2012-04-23
    • 2013-01-10
    • 1970-01-01
    • 2022-12-13
    相关资源
    最近更新 更多