Theboss
Theboss

Reputation: 47

Zend_Session::start() Error #2 Class __PHP_Incomplete_Class has no unserializer

I'm working on a project zend framework 1.12 Where everything works well with session in localhost after reading some article on sessions everything I do for storing variables is the only declarations of a namespace is the following is in the controllers or views:

$ session = new Zend_Session_Namespace ('session'); 
$ session-> var1 = $ var1 
$ session-> var2 = $ var2 

but after the deployement project online I always get the following error:

Zend_Session :: start () - / var / www / vhosts / x.com / httpdocs / project / library / Zend / session.php (Line: 477): Error # 2 Class __ PHP_Incomplete_Class Has No unserializer

stack trace:

#0 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /var/www/vhosts/x.com/httpdocs/project/application/controllers/IndexController.php(25): Zend_Session_Namespace->__construct('session')
#2 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Controller/Action.php(516): IndexController->packageAction()
#3 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('packageAction')
#4 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#5 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#6 /var/www/vhosts/x.com/httpdocs/project/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#7 /var/www/vhosts/x.com/httpdocs/project/surf/index.php(26): Zend_Application->run()
#8 {main}

I really look for a solution and I just knew the cause of the problem: I must declare in bootstrap.php

 public function _initSession () {
         Zend_Session :: start (); 
     }

and before calling $ session = new Zend_Session_Namespace ('session'); I must called Zend_Session :: start ();

I must even make a configuration according to what I read in various forums in App.ini file but I really do not know the configuration

I made several attempts but without result I find a problem how to organize things so that's works.

I beg you to help me because I have to make this project online as soon as possible

Upvotes: 0

Views: 1010

Answers (1)

Theboss
Theboss

Reputation: 47

Finally, here is a solution I touched nothing in the bootstrap.php everything I've done is add a directory named sessions (for example)

and added the following line in application.ini:

resources.session.save_path APPLICATION_PATH = "/ sessions /"

Upvotes: 1

Related Questions