任何人都对此有所帮助,它非常奇怪,而且我已经没有想法了。
我通过注释掉include / config.php中的2行来手动禁用编译器,我还删除了includes / src和includes / stat目录,但是当我尝试编辑产品时出现错误因为magento试图在已编译的includes / src文件夹中包含文件(不再存在)
当我收到另一个错误时,我也尝试在编译的网站上重新编译和访问。
Fatal error: require_once(): Failed opening required 'Mage/Adminhtml/Block/Widget/Grid.php' (include_path='/content/includes/src:.:/usr/share/pear:/usr/share/php') in /content/includes/src/Uni_Fileuploader_Block_Adminhtml_Widget_Grid.php on line 9
我正在计算对网站进行排序,这样我至少可以在禁用编译器的情况下进行编辑,然后解决已编译网站的问题,但目前无法做到,因为即使禁用编译器,magento似乎也想要访问已编译的文件。
运行1.7.0.2
此外 - 这可能与此有关,也可能没有。
当我从命令行运行compiler.php时,我得到了一堆警告,但是编译过程似乎仍然有效。
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Model/App.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Varien/Event/Collection.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Varien/Event/Observer/Collection.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Model/Config.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Model/Config/Base.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Varien/Simplexml/Config.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Model/Config/Options.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Varien/Object.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Varien/Profiler.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Model/Store/Exception.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Mage/Core/Exception.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log/Formatter/Simple.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log/Formatter/Interface.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log/Writer/Stream.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log/Writer/Abstract.php - bailing in /content/lib/Varien/Autoload.php on line 93
PHP Warning: include(): realpath failed to canonicalize Zend/Log/FactoryInterface.php - bailing in /content/lib/Varien/Autoload.php on line 93
答案 0 :(得分:1)
关于问题的第二部分:您是否有机会使用APC?
在这种情况下,this bug report可能与您相关。简而言之,在/etc/php5/conf.d/20-apc.ini
的基于Debian的系统上编辑您的APC配置并设置:
apc.stat=1
请记住清理APC和magento缓存,然后尝试再次运行编译器。
答案 1 :(得分:0)
我不想关闭apc.stat=1
因为此功能可以加快您的安装速度。我有一个修复,但它不是最好的修复,因为你需要更改核心中的代码。
转到“lib / Varien / Autoload.php”文件并滚动到第93行。
更改强>
return include $classFile;
使用(不是最漂亮的修复)
if (file_exists(realpath(dirname(dirname(dirname(__FILE__)))).'/app/code/core/'.$classFile) or
file_exists(realpath(dirname(dirname(dirname(__FILE__)))).'/app/code/community/'.$classFile) or
file_exists(realpath(dirname(dirname(dirname(__FILE__)))).'/app/code/local/'.$classFile) or
file_exists(realpath(dirname(dirname(dirname(__FILE__)))).'/lib/'.$classFile)) {
return require_once $classFile;
} else {
return include $classFile;
}
我使用file_exists
功能的原因很简单。如果包含的文件不存在且脚本继续运行,则函数include()
会出错。函数require()
也会出错,但会停止运行脚本。有了这个修复,Magento一直在运行,就像它总是运行一样,但没有APC-cache错误,如果包含的文件不存在,你的Magento安装会继续运行并且不会停止渲染。
您也可以降级APC扩展程序。在版本3.1.9(最后一个稳定版本)中,您不会收到此错误。