views:

44

answers:

1

I'm getting an error when trying to include Session.php for the Zend Framework.

Here's how I include it:

$ZEND_LIBRARY_PATH = "path_to_zend_library_folder";
set_include_path( get_include_path() . PATH_SEPARATOR . $ZEND_LIBRARY_PATH); 
include_once '../classes/zend/library/zend/Session.php';
$account_info = new Zend_Session_Namespace('account');

The file gets included ok, but I get this error: Cannot redeclare class Zend_Session How can I get this to work?

+1  A: 

It looks like you are trying include that class second time.. Try to comment include_once line and check if it works without it. Maybe you use autoload already.

hsz
thanks hsz, but I get this error: `"Fatal error: Class 'Zend_Session_Namespace' not found"` I haven't installed the framework with a bootstrap, I just include the classes as I need, and don't use the auto loader. Currently the only zend classes I use are currency and date classes. any other ideas?
Ronedog
Try to include `../classes/zend/library/zend/Session/Namespace.php`
hsz
Still another fatal error: `"Fatal error: Cannot redeclare class Zend_Session_Namespace"`
Ronedog
With that last warning you had only one (`...../Session/Namespace.php`) include in your code ?
hsz
correct. I verified.
Ronedog