【问题标题】:Typo3 crashed after installing extension: Parse error: syntax errorTypo3 安装扩展后崩溃:解析错误:语法错误
【发布时间】:2017-01-20 15:19:00
【问题描述】:

我正在运行 Typo3 7.6,并愚蠢地在我的网站上尝试了一个过时的扩展。我遇到了一个错误,试图卸载扩展程序,这让事情变得更糟。现在整个系统从前后崩溃,出现这个错误:

解析错误:语法错误,出现意外的“=” /html/typo3/typo3_src-7.6.10/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php 在第 1654 行

不确定它要我如何处理这些信息。

这是我在 ExtensionManagementUtility.php 第 1654 行的代码

    /**
 * Execute ext_localconf.php files from extensions
 *
 * @return void
 */
protected static function loadSingleExtLocalconfFiles()
{
    // This is the main array meant to be manipulated in the ext_localconf.php files
    // In general it is recommended to not rely on it to be globally defined in that
    // scope but to use $GLOBALS['TYPO3_CONF_VARS'] instead.
    // Nevertheless we define it here as global for backwards compatibility.
    global $TYPO3_CONF_VARS;
    foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $_EXTKEY => $extensionInformation) {
        if ((is_array($extensionInformation) || $extensionInformation instanceof \ArrayAccess) && isset($extensionInformation['ext_localconf.php'])) {
            // $_EXTKEY and $_EXTCONF are available in ext_localconf.php
            // and are explicitly set in cached file as well
            $_EXTCONF = isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]) ? $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] : null;
            require $extensionInformation['ext_localconf.php'];
        }
    }
}

我该如何摆脱这个烂摊子?

【问题讨论】:

    标签: php error-handling syntax-error parse-error typo3-7.6.x


    【解决方案1】:

    如果您只想恢复安装,则需要停用该新扩展。

    您可以尝试在安装工具中执行此操作(只需调用 your-domain.tld/typo3/install/):在“重要操作”区域中,您可以找到选项检查损坏的扩展程序

    或者您手动操作:编辑typo3conf/PackageStates.php,搜索该扩展并将状态从active 更改为inactive。然后清除所有缓存!

    之后你可以删除扩展。

    【讨论】:

    • 是的! Bernd Wilke πφ,成功了。我不得不手动完成,因为无法访问 CMS。感谢您提供的简单说明,以便轻松修复。
    【解决方案2】:

    这个问题似乎来自其中一个包含的文件,即您的扩展之一的配置。我不明白为什么 PHP 不显示实际的文件名,但是……让我们尝试修复它:

    要获取文件名,请在require… 前插入一行以输出:

    echo $_EXTKEY, " ", $extensionInformation['ext_localconf.php'], "\n";
    require $extensionInformation['ext_localconf.php'];
    

    重新加载后,您应该会看到扩展键和文件名的列表,最后一个是导致问题的那个。

    【讨论】:

      猜你喜欢
      • 2021-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多