#1 2025-01-16 21:47:58

dev3
Member
2021-02-01
26

PHP 8.4.2 - works fine

In case anyone was interested this is just a quick note to say that the current version of Piwigo does not work  with the new PHP 8.4.2.

Actually it renders fine but won't let you log in... gives message that browser is blocking cookies... which it is not.

Going back to PHP 8.3 worked fine.

I searched the forums looking to find out but didn't see anything, so I just tried it myself on my server.

Offline

 

#2 2025-01-17 01:00:33

Schneider-Fotografie
Extension maintainer
Berlin
2023-04-16
160

Re: PHP 8.4.2 - works fine

Hello dev3

I use Piwigo 15.3.0 with PHP version 8.4.1 and everything works even with 35 activated plugins.

Olaf


-Schneider-Photography- Gallery
----------------------------------
BYB | Block You Bots
„Stay human. I block the rest.“

Offline

 

#3 2025-01-17 01:19:57

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

I can only suggest that there is a difference between 8.4.1 and 8.4.2 which I doubt. Maybe my ISP has it configured incorrectly? That version is brand new to them.

-Al

Offline

 

#4 2025-01-17 10:25:54

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

I'm running 2 instances with PHP 8.4.2 and 13 plugins - haven't seen any issues so far.

Piwigo 15.3.0
Operating system: Linux
PHP: 8.4.2 (Show info) [2025-01-17 09:23:30]
MySQL: 11.4.4-MariaDB [2025-01-17 10:23:30]
Graphics Library: ImageMagick ImageMagick 6.9.13-17

Offline

 

#5 2025-01-17 15:58:33

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

henker wrote:

I'm running 2 instances with PHP 8.4.2 and 13 plugins - haven't seen any issues so far.

Piwigo 15.3.0
Operating system: Linux
PHP: 8.4.2 (Show info) [2025-01-17 09:23:30]
MySQL: 11.4.4-MariaDB [2025-01-17 10:23:30]
Graphics Library: ImageMagick ImageMagick 6.9.13-17

I don't know what the issue is at my end.

As I said, Piwigo renders fine in user mode but it won't let me log in the the admin. backend. The error is from Piwigo  identification.php... a. box with red font:

"Cookies are blocked or not supported by your browser. You must enable cookies to log in."

I assume you have logged in.

Do you have any special php.ini or user.ini settings?

-Al

Last edited by dev3 (2025-01-17 16:00:56)

Offline

 

#6 2025-01-17 18:03:38

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

dev3 wrote:

The error is from Piwigo  identification.php... a. box with red font:
"Cookies are blocked or not supported by your browser. You must enable cookies to log in."
I assume you have logged in.
Do you have any special php.ini or user.ini settings?

No particular "special" settings here, and those are almost identical to the previous PHP 8.3 settings.

Are your session settings correct and is the cookie actually set ? In identification.php, I see

Code:

if (isset($_POST['login']))
{
  if (!isset($_COOKIE[session_name()]))
  {
    $page['errors'][] = l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.');
  }
  else

Offline

 

#7 2025-01-17 19:09:14

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

I have the same code as you in the indentification.php module.

How do I check to see if the session name is set (which it obviously is not.)

Offline

 

#8 2025-01-17 21:03:05

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

I'd go to maintenance-> check PHP info and look at the session.* values, e.g.

Code:

session.auto_start  Off  Off
session.cache_expire  180  180
session.cache_limiter  nocache  nocache
session.cookie_domain  no value  no value
session.cookie_httponly  On  Off
session.cookie_lifetime  0  0
session.cookie_path  /gallery/  /
session.cookie_samesite  Strict  no value
session.cookie_secure  On  Off
...

Offline

 

#9 2025-01-17 21:07:01

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

Since I can't log in with php8.4 there is no way to get to 'maintenance' ... unless you mean some file I can see via SFTP or SSH (which is no problem). I'm fairly technical but, of course, I don't know the internals of Piwigo.

Offline

 

#10 2025-01-18 09:48:24

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

Try to compare the session.* settings of the php.ini settings for PHP 8.4 to the settings of PHP 8.3 - are there any differences ?

Offline

 

#11 2025-01-18 17:41:45

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

henker wrote:

Try to compare the session.* settings of the php.ini settings for PHP 8.4 to the settings of PHP 8.3 - are there any differences ?

Here are the difference between PHP 8.3 and 8.4 for session * in the php.ini.

8.4                                          Local   Master
session.sid_bits_per_character      4       4
session.sid_length                        32     32
session.gc_divisor                      100    100


8.3

session.sid_bits_per_character     5       5
session.sid_length                      26      26
session.gc_divisor                     1000    1000

Does any of this make any sense to you?

EDIT: I tired putting the three 8.3 values (above) in a .user.ini file. I found out that session.sid_bits_per_character and session.sid_length  have been Deprecated as of PHP 8.4.0. I tried with just the session.gc_divisor = 1000 but I got the same error message about cookies being blocked when trying to log in. Otherwise the site work fine with PHP8.4. I just can't access the admin panels. There has to be a reason!

Last edited by dev3 (2025-01-18 18:22:11)

Offline

 

#12 2025-01-19 14:33:50

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

I have the same session*-settings for PHP 8.4 as yours.
And just curious - have you tried another browser and/or incognito mode ?

Offline

 

#13 2025-01-19 16:23:41

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

henker wrote:

I have the same session*-settings for PHP 8.4 as yours.
And just curious - have you tried another browser and/or incognito mode ?

Yes, I've tried in Safari and in 'private' mode with Brave.

I've asked my ISP but they were no help. They claim that since the latest Piwigo version came out in Oct. and they PHP 8.4 in November that eventually enough Piwigo users will try 8.4 and will get the same result as I get... and the Piwigo team will look into it.

Why your many galleries work on 8.4. is beyond me. Are you using a .user.ini file? If so, what is in it? How about something that might be in an .htaccess file?

Offline

 

#14 2025-01-19 17:52:38

henker
Member
Warsaw
2014-09-01
43

Re: PHP 8.4.2 - works fine

I'm using a global php.ini in 8.4 which is more or less the same as the 8.3 one and some local config settings:
ini_set('display_errors', '0');
ini_set('session.cookie_secure', 1);
ini_set('session.cookie_samesite', 'Strict');
ini_set('session.use_strict_mode', '1');

- this just works on 8.4 as it did on 8.3.

Are these "On" in your environment ?

Code:

session.use_cookies  On  On
session.use_only_cookies  On  On

Offline

 

#15 2025-01-19 18:25:21

dev3
Member
2021-02-01
26

Re: PHP 8.4.2 - works fine

Per you suggestions, put these into a .user.ini file and ran with 8.4:

display_errors=0
session.cookie_secure=1
session.cookie_samesite=Strict
session.use_strict_mode=1

I checked phpinfo() and they are set. However, I got the same old "cookies blocked" error.

(Note: these settings also work with 8.3... made no difference... but I normally don't use a .user.ini file with 8.3)


Yes..
session.use_cookies  On  On
session.use_only_cookies  On  On

are both set in the php.ini.

There is to be something in my ISP's build of PHP8.4 that is causing this... but what?

Thanks,

-Al

Offline

 

Board footer

Powered by FluxBB