New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session_start with php 7.1 #611

Closed
FanchTheSystem opened this Issue Jan 30, 2017 · 9 comments

Comments

Projects
None yet
3 participants
@FanchTheSystem
Copy link

FanchTheSystem commented Jan 30, 2017

there is an error about read data for start_session () with php 7.1

"Warning: session_start(): Failed to read session data: user (path: ) in /usr/share/webapps/piwigo/include/common.inc.php on line 149"

So session does not start, and you can't login.

To resolve this, I have add in the file :
piwigo/include/functions_session.inc.php, function pwg_session_read($session_id), the following to check if the data is null :

if ($result)
{
$row = pwg_db_fetch_assoc($result);

if (is_null($row['data'])) {
return '';
}
return $row['data'];
}

else
{
return '';
}

I am not sure it is the best test to do, but it work well

@flop25

This comment has been minimized.

Copy link
Member

flop25 commented Jan 30, 2017

Hello
version of php/piwigo/server etc please ?
Thank you

@FanchTheSystem

This comment has been minimized.

Copy link
Author

FanchTheSystem commented Jan 30, 2017

PHP :
PHP 7.1.1 (cli) (built: Jan 18 2017 18:44:22) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.1, Copyright (c) 1999-2017, by Zend Technologies

Web Server:
Server version: Apache/2.4.25 (Unix) Server built: Dec 20 2016 13:02:22

Host:
Linux 3.14.32-xxxx-grs-ipv6-64 #7 SMP Wed Jan 27 18:05:09 CET 2016 x86_64 GNU/Linux

I think it is due to PHP 7.1 as it return null value when there is no result from sql queries.
It look like it is a common issue for all webapp who use database to store session.

http://www.php.net/ChangeLog-7.php#7.1.0

Version 7.1.0
01 Dec 2016
Core:
Added nullable types.
....

@FanchTheSystem

This comment has been minimized.

Copy link
Author

FanchTheSystem commented Jan 30, 2017

And it is for piwigo 2.8.5

@flop25

This comment has been minimized.

Copy link
Member

flop25 commented Jan 30, 2017

try 2.8.6

@FanchTheSystem

This comment has been minimized.

Copy link
Author

FanchTheSystem commented Jan 30, 2017

same with 2.8.6

@flop25

This comment has been minimized.

Copy link
Member

flop25 commented Jan 30, 2017

ok Thx!

@plegall

This comment has been minimized.

Copy link
Member

plegall commented May 23, 2017

@FanchTheSystem is it still a problem with PHP 7.1.5 ?

@FanchTheSystem

This comment has been minimized.

Copy link
Author

FanchTheSystem commented May 24, 2017

Yes it work well with php 7.1.5 and piwigo 2.9.0

Thank you!

@plegall

This comment has been minimized.

Copy link
Member

plegall commented May 24, 2017

Great :-) let's close this issue then!

@plegall plegall closed this May 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment