dougong9987 2010-07-29 16:47
浏览 51
已采纳

无法重新声明类Zend_Loader_Autoloader

I am using Zend Debugger to debug my php application built based on the Zend Framework. Currently I am running the 1.10.6 version. When debugging my application i Get this error:

Compile Error: /var/www/Zend/ZendFramework-1.10.6/library/Zend/Loader/Autoloader.php line 36 - Cannot redeclare class Zend_Loader_Autoloader

Is this just a bug in the Zend Framework or does it have anything to do with a misconfiguration in my application.php?

$paths = array(

    realpath(dirname(__FILE__).'/../library'),
    '.',
);
*/


defined('APPLICATION_PATH') 
    or define('APPLICATION_PATH', realpath(dirname(__FILE__).'/../application'));
defined('APPLICATION_ENV')
    or define('APPLICATION_ENV', 'development');

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH.'/../library'),
)));    


//require_once('Zend/Loader/Autoloader.php');   
require_once('Zend/Application.php');

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH.'/configs/events.ini'  
);

$application->bootstrap()->run();
  • 写回答

3条回答 默认 最新

  • duanliangman5398 2010-07-29 19:23
    关注

    Perhaps you're include()-ing or require()-ing the file somewhere without knowing it. Try sticking this code at the top of Autoloader.php:

    if (!isset($GLOBALS['zend_autoloader_loaded'])) {
        $GLOBALS['zend_autoloader_loaded'] = true;
    }
    else {
        print_r(debug_backtrace());
        die;
    }
    

    The trace will indicate where Autoloader.php is being required for the 2nd time.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号