Opened 3 years ago

Closed 3 years ago

#1901 closed Bug (fixed) - doesn't work with php-cgi

Reported by: vipsoft Owned by:
Priority: normal Milestone: Piwik 1.1
Component: Core Keywords:
Cc: Sensitive: no


We need a quick fix until #1279 is addressed.

Reported in our German forum,63321 (and reproduceable locally), when using php-cgi, the script fails immediately:

exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser; 
output started in /0' in /kunden/.../webroots/ssl/piwik/libs/Zend/Session.php:454 
Stack trace: #0 /kunden/.../webroots/ssl/piwik/core/Session.php(81): Zend_Session::start() 
#1 /kunden/.../webroots/ssl/piwik/index.php(51): Piwik_Session::start()

Because Zend_Session throws an exception if session.auto_start = 1, we require session.auto_start = 0.

Calling simply session_start(), I get the following (but not when session.auto_start = 1):

Warning:  session_start() [function.session-start: Cannot send session cookie - headers already sent in - on line 1

Warning:  session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at -:1) in - on line 1

Change History (1)

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [3468]) fixes #1901, refs #1592 - we can't use mock objects because of static method calls, so the wrappers around Zend_Session and Zend_Session_Namespace dummy initialize when executing from php-cli or headless php-cgi; this also addresses the hack by Parallels in their APS scripts

Note: See TracTickets for help on using tickets.