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?

Boris Guéry
  • 47,316
  • 8
  • 52
  • 87
Ronedog
  • 2,313
  • 8
  • 43
  • 85

1 Answers1

1

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
  • 148,279
  • 62
  • 259
  • 315
  • 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 May 18 '10 at 21:32
  • Try to include `../classes/zend/library/zend/Session/Namespace.php` – hsz May 18 '10 at 21:39
  • Still another fatal error: `"Fatal error: Cannot redeclare class Zend_Session_Namespace"` – Ronedog May 18 '10 at 22:16
  • With that last warning you had only one (`...../Session/Namespace.php`) include in your code ? – hsz May 19 '10 at 09:52