Php 安装扩展插件后Typo3崩溃:解析错误:语法错误
我正在运行Typo37.6,愚蠢地在我的网站上尝试了一个过时的扩展。我遇到一个错误,试图卸载扩展,这只会让事情变得更糟。现在,整个系统因以下错误而前后崩溃: 分析错误:语法错误,中出现意外的“=” /html/typo3/typo3_src-7.6.10/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php 在线1654 不确定它想让我怎么处理这些信息 这是我在第1654行的ExtensionManagementUtility.php中的代码:Php 安装扩展插件后Typo3崩溃:解析错误:语法错误,php,error-handling,syntax-error,parse-error,typo3-7.6.x,Php,Error Handling,Syntax Error,Parse Error,Typo3 7.6.x,我正在运行Typo37.6,愚蠢地在我的网站上尝试了一个过时的扩展。我遇到一个错误,试图卸载扩展,这只会让事情变得更糟。现在,整个系统因以下错误而前后崩溃: 分析错误:语法错误,中出现意外的“=” /html/typo3/typo3_src-7.6.10/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php 在线1654 不确定它想让我怎么处理这些信息 这是我在第1654行的ExtensionManagementUtil
/**
* 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不显示实际的文件名,但是……让我们尝试修复它: 要获取文件名,请在
require…
之前插入一行以将其输出:
echo $_EXTKEY, " ", $extensionInformation['ext_localconf.php'], "\n";
require $extensionInformation['ext_localconf.php'];
重新加载后,您应该会看到扩展密钥和文件名的列表,最后一个是导致问题的扩展密钥和文件名。如果您只想恢复安装,则需要停用该新扩展 您可以尝试在安装工具中执行此操作(只需调用domain.tld/typo3/install/):在“重要操作”区域中,您可以找到选项检查损坏的扩展 或者手动执行:编辑
typo3conf/PackageStates.php
,搜索该扩展名并将状态从active
更改为inactive
。然后清除所有的缓存
之后,您可以卸下扩展。是!伯纳德·威尔克,这就成功了。我不得不手工操作,因为无法访问CMS。感谢您提供的简单说明,使修复变得相当简单。