dman75 (4) [Avatar] Offline
#1
I'm getting the following error:

Fatal error: Class 'Zend_Layout' not found in /home/fashion/public_html/application/bootstrap.php on line 41

My setup is linux CentOS

I think its a config error? the book I believe is using apache ?

anyway my index.php is on the root (public_html)

these folders exist inside (public_html)
application
library
tests


any help please would be great!
akrabat (479) [Avatar] Offline
#2
Re: Fatal error: Class 'Zend_Layout' not found
Hi,

Have another read of the directory layout sections. application, library and tests should not be inside public_html.

Regards,

Rob...
dman75 (4) [Avatar] Offline
#3
Re: Fatal error: Class 'Zend_Layout' not found
thanks for the reply I have moved the directories you mentioned

but now I'm getting this error

Fatal error: Call to undefined method Zend_Controller_Action_HelperBroker::getstack() in /home/fashion/library/Zend/Layout.php on line 295

any help? thanks
akrabat (479) [Avatar] Offline
#4
Re: Fatal error: Class 'Zend_Layout' not found
That method doesn't exist smilie

Rob...
dman75 (4) [Avatar] Offline
#5
Re: Fatal error: Class 'Zend_Layout' not found
I have the latest zend 1.9.2 and I have HelperBroker.php in
/library/Zend/Controller/Action

can you give me some more tips smilie
thanks

also this is my index.php

<?php <br /> // For the ZFiA source code distribution, we have one copy of Zend
// Framework, so we add it to the include path here.
$lib = realpath(dirname(basename(__FILE__)) . '/../../lib');
set_include_path(get_include_path() . PATH_SEPARATOR . $lib );

include '../application/bootstrap.php';

// Specify your config section here or use an environment variable
$configSection = getenv('PLACES_CONFIG') ? getenv('PLACES_CONFIG') : 'dev';
$bootstrap = new Bootstrap('general');
$bootstrap->runApp();

Message was edited by:
dman75
dman75 (4) [Avatar] Offline
#6
Re: Fatal error: Class 'Zend_Layout' not found
Acutally I had an older version of Zend!

but now I'm getting this other error

Fatal error: Class 'Places_Acl' not found in /home/fashion/application/bootstrap.php on line 50
apprentice (77) [Avatar] Offline
#7
Re: Fatal error: Class 'Zend_Layout' not found

I have the latest zend 1.9.2 and I have HelperBroker.php in
/library/Zend/Controller/Action

can you give me some more tips smilie
thanks




What tutorial are you following?

Are you using the Zend Framework in Action source codes + the included Zend catalog version 1.7.1 found here when testing things?
http://www.manning.com/allen/

Because the codes from that zip file only works with Zend versions below 1.8.
Anubis (1) [Avatar] Offline
#8
Re: Fatal error: Class 'Zend_Layout' not found
Hi,
if the fatal error: "Class 'Places_Acl' not found" occurs, you have probably changed the registration of the occurs, because of this notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0

You can resolve that in bootstrap.php:

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Places_');
//to get models classes
$autoloader->setFallbackAutoloader(true);

By default, the autoloader is configured to match the "Zend_" and "ZendX_" namespaces. 'Places' has its own library code. So it has to be registered with the autoloader using the registerNamespace() method.
http://framework.zend.com/manual/en/zend.loader.autoloader.html
http://www.zendframeworkinaction.com/errata/
http://akrabat.com/2009/04/30/zend_loaders-autoloader_deprecated-in-zend-framework-18/

For models classes it will be better to use an own namespace and resource autoloader:
http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html

hth