I just copied over our files and database. Everything seems to be there with the right permissions and linked up to the right database and the right database pointing to the right path. Any ideas why I get this error?
1条回答 默认 最新
douyi3632 2014-04-04 23:15关注That's an interesting error.
Magento Fatal error: include(): Cannot redeclare class varien_profiler in /lib/Varien/Autoload.php on line 93
It's interesting because I'd expect to see
Varien_Profiler, and not `varien_profiler'. The line that's throwing this error is the last of your autoload method.#File: lib/Varien/Autoload.php public function autoload($class) { if ($this->_collectClasses) { $this->_arrLoadedClasses[self::$_scope][] = $class; } if ($this->_isIncludePathDefined) { $classFile = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class; } else { $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class))); } $classFile.= '.php'; //echo $classFile;die(); return include $classFile; }What's odd about your error is it seems like someone tried to declare/use a
varien_profilerclass. However, all the standard Magento references to this class are
Varien_ProfilerWith leading word case. When you use
Varien_Profiler, Magento will try to include the filelib/Varien/Profiler.phpHowever, in your case, Magento should try to include the file
lib/varien/profiler.phpWhich is different — and doesn't exist in a standard installation. I'm guessing you downloaded this from a heavily modified unix system — and pulled it down to a Mac or Windows system where case sensitivity isn't an issue.
All that's a long way of saying — this is an issue with your specific installation, and you'll need to debug it. The best way, as other commenters have noted, is to get a stack trace and find out where the rouge
varien_profileris coming from, and then fix it so it'sVarien_Profiler. Temporarily modify the function above with the following codeif($class == 'varien_profiler') { mageDebugBacktrace(); exit; } return include $classFile;This will output a simplified stack trace of files.php:line-number — something like this
[1] : [2] /Users/alanstorm/Sites2014/magento-march2014.dev/app/Mage.php:665 [3] /Users/alanstorm/Sites2014/magento-march2014.dev/index.php:87This should let you track down the rouge declaration.
解决 无用评论 打赏 举报