Support > cpg1.6 language

Error in langmgr.php on line 318 on php 8.x

(1/1)

Asio Otus:
Error in langmgr.php on line 318 on php 8.x

Hello.
I updated the gallery version to 1.6.19, if the version of the php server is 8.x, then the language cannot be changed, if you lower the version to 7.4, then there are no problems with choosing the language.

There is an error in the Language Manager if the php server version is 8.x



--- Quote ---Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, bool given in ***/gallery/langmgr.php:318 Stack trace: #0 ***/gallery/langmgr.php(318): fclose(false) #1 {main} thrown in ***/gallery/langmgr.php on line 318
--- End quote ---

ron4mac:
Can not reproduce the error. What exact version of PHP causes the error for you.

Asio Otus:

--- Quote from: ron4mac on May 10, 2022, 12:22:55 am ---Can not reproduce the error. What exact version of PHP causes the error for you.

--- End quote ---

PHP Version 8.0.17, if I lower the version to 7.4.29, then there is no such error

ron4mac:
Using PHP 8.0.18, I have seen no error.  A normally configured PHP version should not generate an error on that line.  Perhaps there is a configuration issue with your version of PHP.  Or perhaps it is a bug in PHP 8.0.17 (but fixed in 8.0.18).

If you need some solution for your particular situation, you can try replacing line 318 in langmgr.php with:

--- Code: ---if ($handle) @fclose($handle);
--- End code ---

Navigation

[0] Message Index

Go to full version