Piwigo 2.8.3 session_start() - error with PHP 7.1 on Windows Server 2016 (IIS10) #542

Closed
opened 2026-10-05 00:03:04 +02:00 by adam · 8 comments
Owner

Hello,

I cannot login on a fresh installation and on an older one I have a lot of problems regarding this error. With other application (like wordpress or others) there are no errors. So the problem must be in the piwigo. I am not a php-crack therefore I ask here to get help.

Error: Warning: session_start(): Failed to read session data: user (path: ) in ..... include\common.inc.php on line 149

The same is with a fresh piwigo 2.9b installation on line 156 - and there I cannot login.

kind regards

mcinternet

Hello, I cannot login on a fresh installation and on an older one I have a lot of problems regarding this error. With other application (like wordpress or others) there are no errors. So the problem must be in the piwigo. I am not a php-crack therefore I ask here to get help. Error: Warning: session_start(): Failed to read session data: user (path: ) in ..... include\common.inc.php on line 149 The same is with a fresh piwigo 2.9b installation on line 156 - and there I cannot login. kind regards mcinternet <!-- github-sync-id:196953306 -->
adam closed this issue 2026-10-05 00:03:05 +02:00
Author
Owner

same here, started after upgrade to php-7.1

Warning: session_start(): Failed to read session data: user (path: /tmp) in /var/www/default/gal/include/common.inc.php on line 156

/tmp has proper permission

same here, started after upgrade to php-7.1 `Warning: session_start(): Failed to read session data: user (path: /tmp) in /var/www/default/gal/include/common.inc.php on line 156` /tmp has proper permission <!-- github-comment-id:268549665 -->
Author
Owner

tmp / _data also has proper permissions

regards

tmp / _data also has proper permissions regards <!-- github-comment-id:268558576 -->
Author
Owner

Hi @mcinternet and @mirlang it sounds "a lot" like http://piwigo.org/forum/viewtopic.php?id=27103 where Zentalquabula seems to have found how it could be fixed.

Hi @mcinternet and @mirlang it sounds "a lot" like http://piwigo.org/forum/viewtopic.php?id=27103 where Zentalquabula seems to have found how it could be fixed. <!-- github-comment-id:268588060 -->
Author
Owner

no time to register in the forum, so i'm replying here: i tried rvelices' suggestion, which works for me :)

diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php
index e75f22e12..9d887355d 100644
--- a/include/functions_session.inc.php
+++ b/include/functions_session.inc.php
@@ -145,7 +145,7 @@ SELECT data
   WHERE id = \''.get_remote_addr_session_hash().$session_id.'\'
 ;';
   $result = pwg_query($query);
-  if ($result)
+  if (pwg_db_num_rows($result))
   {
     $row = pwg_db_fetch_assoc($result);
     return $row['data'];

no time to register in the forum, so i'm replying here: i tried rvelices' suggestion, which works for me :) ``` diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php index e75f22e12..9d887355d 100644 --- a/include/functions_session.inc.php +++ b/include/functions_session.inc.php @@ -145,7 +145,7 @@ SELECT data WHERE id = \''.get_remote_addr_session_hash().$session_id.'\' ;'; $result = pwg_query($query); - if ($result) + if (pwg_db_num_rows($result)) { $row = pwg_db_fetch_assoc($result); return $row['data']; ``` <!-- github-comment-id:268596303 -->
Author
Owner

That works for me - fine! Tanks!
No I have other two problems. During the error I created 2 new galeries. The have been created with errors and I cannot delete them.
2nd: in the user-account area is this error:
DataTables warning (table id = 'userList'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

Regards

That works for me - fine! Tanks! No I have other two problems. During the error I created 2 new galeries. The have been created with errors and I cannot delete them. 2nd: in the user-account area is this error: DataTables warning (table id = 'userList'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. Regards <!-- github-comment-id:269120134 -->
Author
Owner

AND: I cannot delete any galery

Regards

AND: I cannot delete any galery Regards <!-- github-comment-id:269120155 -->
Author
Owner

Now all seams to work!
My workaround: I deleted the DB-User and created a new one with all rights. Now it works!
best wishes
kind regards

Now all seams to work! My workaround: I deleted the DB-User and created a new one with all rights. Now it works! best wishes kind regards <!-- github-comment-id:269120624 -->
Author
Owner

Had same issue after upgrading to 2.8.6
Applying @mirlang suggestion resolved my login issue.
Login was going in a loop not capturing the credentials on server and redirecting to home page.
All working now

Had same issue after upgrading to 2.8.6 Applying @mirlang suggestion resolved my login issue. Login was going in a loop not capturing the credentials on server and redirecting to home page. All working now <!-- github-comment-id:290412090 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#542