Upgrade from php 5,3.x to 5.6.x

80x-older-eol
help

#1

Hello, my web provider changed from php 5.3 to 5.6, and my OC6.0.8 no longer works..

I have tracked it to $_SESSION data not beeing set correctly.

After logging in, session data is lost.

Owncloud.log;
{"app":"PHP","message":"session_start(): Unexpected end of serialized data at (!-- removed --!) \lib\private\session\internal.php#21","level":3,"time":"2016-08-08T13:59:29+00:00"}
{"app":"PHP","message":"session_start(): Failed to decode session object. Session has been destroyed at (!-- removed --!)\lib\private\session\internal.php#21","level":3,"time":"2016-08-08T13:59:29+00:00"}

I konw oc6 is old but would like to get it to work again, hope someone can help..


#2

Try to clear the session store on your server and also try to connect using a private/incognito browser.


#3

Dose not work.

OC6 uses Objects is $_SESSION, this seems to be incompatible when moving to php 5.6.x

As far as i have been able to test, the change happened during php 5.5.x to php 5.6.x

All works if i run oc on php 5.4.x

Not sure how to make a workaround...


#4

Upgrade to a still supported version of oC? oC 6 is end-of-life since one year and even oC 7 reached end-of-life a few months ago:

https://central.owncloud.org/t/end-of-life-for-oc-7-please-upgrade-asap/848

There is really no point in trying to get this fixed. Either stay at PHP 5.4 or use PHP 5.6+ with a recent oC version.


#5

Upgrading OC is not an option.

Im using my only apps, would have to rewrite 110K+ lines of code...

And be4 you say that the bug might be in my code; its not, installing a "clean" oc6 yeilds the same error.


#6

Sure, then you're probably hitting a bug in oC 6 which won't get any fixes. So just stay on PHP 5.4 until you're able to do the only sane thing and upgrade to an supported oC version.


#7

Thats the problem my web provider wont go any lower than php 5.6, so untill i fix this my system is down.. :frowning:


#8

I wouldn't run OC 6 on a public server. Put it at least behind a VPN. I see three options:

  • Find a webhost with php 5.4
  • Rewrite your app to make it work with a current OC
  • FIx OC 6 to make it work with php 5.6

If your app is interesting for more people, you could try to motivate some of them for a rewrite.


#9

Fixed it !

lib/private/session/memory.php (changed 'get' and 'set' functions)

`/**
* @param string $key
* @param mixed $value
*/
public function set($key, $value) {
if($key=='loginname') {
$this->data[$key] = $value->getUID();
} else {
$this->data[$key] = $value;
}
}

/**
* @param string $key
* @return mixed
*/
public function get($key) {
if (!$this->exists($key)) {
return null;
}
if($key=='loginname') {
return OC::$server->getUserManager()->get($this->data[$key]);
} else {
return $this->data[$key];
}
}`

Quick and dirty :stuck_out_tongue:

Now just have to fix 'function initL10N(app) ' in core/js/js.js
The async: false in the $.ajax call breaks the translation, quick fix is to set it to 'true',
ofcuz text dont get translated by doing that...
Working on it..


#10

FYI: I removed the solution flag of the post above - it is not a proper solution to manually change code like this.


#11

Do you want to submit a bugfix and do a release for oC 6.0.x including this fix? :wink:


#12

Hell - no :fearful: - but digging in that old code will bring no good ..... upgrade should really be considered as the only meaningful solution.


#13

Hehe, ok. Thought that initially when reading your post. :grin:

So marked the suggestion to upgrade to a recent version as a solution.