Announcement

  •  » Beta testing
  •  » 13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

#1 2022-05-15 12:48:16

kubikanber
Member
2014-06-20
2

13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

Hi

After entering the necessary information on the Piwigo installation page and pressing the start installation button, this error message appears.

HTTP ERROR 500

xampp-linux-x64-8.1.5-0 is installed on the system.

When I look at the php error log:
PHP Fatal error:  Uncaught Error: Call to a member function set_charset() on null in /opt/lampp/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php:88
Stack trace:
#0 /opt/lampp/htdocs/piwigo/install.php(261): pwg_db_check_charset()
#1 {main}
  thrown in /opt/lampp/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php on line 88

Piwigo 13.0.0beta2
Arch Linux
PHP: 8.1.5 (Bilgi Göster) [2022-05-15 11:54:21]
MySQL: 10.4.24-MariaDB [2022-05-15 12:54:21]
Grafik Kütüphanesi: ImageMagick 7.1.0-33


Piwigo URL: http://

Offline

 

#2 2022-05-18 13:34:33

kubikanber
Member
2014-06-20
2

Re: 13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

Hi

This error message will not appear in the "php error log" if the setup page is entered with "https://" from the browser. Just another error message appears. This error message is due to the e-mail settings not being set. If Send email administrator information is selected on the setup page, it would be nice to have a place to manually enter email settings. Or, a notification message may come for these settings to be made later.

$conf['smtp_host'] = ' ';
$conf['smtp_user'] = ' ';
$conf['smtp_password'] = ' ';

When accessing the setup page from the browser without using "https://", the error message comes. To continue to settup, click the back button on the browser, fill in the setup information again and do not select the e-mail notification. Installation continues and everything is fine and no error message appears.

After the installation is finished, many "deprecated in ..." errors appear on the pages because PHP 8.1.5 is installed in my system.

Offline

 

#3 2022-06-08 19:42:38

kubikanber
Member
2014-06-20
2

Re: 13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

Hi,

I think, I found out where the real problem comes from

when i check php error log, shows:

PHP Fatal error:  Uncaught Error: Call to a member function set_charset() on null in /opt/lampp/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php:88
Stack trace:
#0 /opt/lampp/htdocs/piwigo/install.php(261): pwg_db_check_charset()
#1 {main}
  thrown in /opt/lampp/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php on line 88

at line 88 "functions_mysqli.inc.php",

Code:

$mysqli->set_charset($db_charset);

I found that the $mysqli variable was not loaded because the mysql connection was not established. When the code runs, the value of the variable is Null. That's why it throws an error.
If we add a code that checks whether the value is Null or not, the problem is solved.

Code:

if (!is_null($mysqli))
  {
    $mysqli->set_charset($db_charset);
  }

And for the ongoing error message is due to the e-mail "phpmail issue":
php error log shows:

PHP Fatal error:  Uncaught Error: Class "PHPMailer\PHPMailer\Exception" not found in /opt/lampp/htdocs/piwigo/include/phpmailer/PHPMailer.php:1917
Stack trace:
#0 /opt/lampp/htdocs/piwigo/include/phpmailer/PHPMailer.php(1650): PHPMailer\PHPMailer\PHPMailer->mailSend('Date: Wed, 8 Ju...', 'This is a multi...')
#1 /opt/lampp/htdocs/piwigo/include/phpmailer/PHPMailer.php(1486): PHPMailer\PHPMailer\PHPMailer->postSend()
#2 /opt/lampp/htdocs/piwigo/include/functions_mail.inc.php(900): PHPMailer\PHPMailer\PHPMailer->send()
#3 /opt/lampp/htdocs/piwigo/install.php(519): pwg_mail('kubikanber@kubi...', Array)
#4 {main}
  thrown in /opt/lampp/htdocs/piwigo/include/phpmailer/PHPMailer.php on line 1917

at "pwg_mail" function, line 609, 610  "functions_mail.inc.php"

Code:

 include_once(PHPWG_ROOT_PATH.'include/phpmailer/SMTP.php');
 include_once(PHPWG_ROOT_PATH.'include/phpmailer/PHPMailer.php');

Here, when reporting the connection error in phpmail, a required file is not included, so it gives an error message. And if we add this here:

Code:

include_once(PHPWG_ROOT_PATH.'include/phpmailer/Exception.php');

problem solved and installing page works.

Offline

 

#4 2022-06-08 20:02:39

erAck
Only trying to help
2015-09-06
2130

Re: 13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

kubikanber wrote:

If we add a code that checks whether the value is Null or not, the problem is solved.

Code:

if (!is_null($mysqli))
  {
    $mysqli->set_charset($db_charset);
  }

No, it does not solve, it hides the problem that there is no database connection. Continuing without and not setting the charset and maybe failing later is worse than failing completely from the beginning.

And for the ongoing error message is due to the e-mail "phpmail issue":

See https://github.com/Piwigo/Piwigo/pull/1633 . Still not merged.


Running Piwigo at https://erack.net/gallery/

Offline

 
  •  » Beta testing
  •  » 13.0.0beta2 (PHP: 8.1.5) gives HTTP ERROR 500 during setup process

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact