Common Zend Framework Errors

1.Error: (Console)

Fatal error: Cannot redeclare class Zend_Loader in /path-to-zend/Loader.php on line

Ans:

goto your application.ini file , just remove this line

1
includePaths.library = APPLICATION_PATH "/../library"

Why i did so:

Because ,if you are generating Project using Zend tool , then zen_tool autometically add this line to the ini file ,but it should not be there.Hope it will be solved in future release of ZF.

 

2.Error (BootStrap)

Fatal error: Uncaught exception ‘Zend_Application_Bootstrap_Exception’ with message ‘Resource matching “view” not found’ in C:xamppphpPEARZendApplicationBootstrapBootstrapAbstract.php:

Ans:

Add a line as resources.view[] = “” into the application.ini file.

Generally this error occur when you are handling view from your bootstrap.php page

What it does ,it just make the view as blank and empty and expecting array of view objects as key.

 

3.Error (layout)

After layout design ,you are unable to find external css and javascript files while browsing through different controller and action.

Ans:

Your every external javascript and css file shoud reside inside public folder.Its always better to give full path of javascript and css file in view script or in layout file like as follows

<link rel=”stylesheet” href=”<?php echo $this->baseUrl(); ?>/css/style.css” type=”text/css” media=”screen” />
<script type=”text/javascript” src=”<?php echo $this->baseUrl(); ?>/js/jquery.js”></script>