Skip to content
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

in PHP 8.0, when enabling MySQL SSL, got a HTTP 500 #17782

Closed
robinverstrepen opened this issue Jul 17, 2021 · 2 comments · Fixed by #17788
Closed

in PHP 8.0, when enabling MySQL SSL, got a HTTP 500 #17782

robinverstrepen opened this issue Jul 17, 2021 · 2 comments · Fixed by #17788
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@robinverstrepen
Copy link

Expected Behavior

Working matomo interface

Current Behavior

HTTP error 500

PHP Fatal error:  Uncaught TypeError: mysqli_options(): Argument #2 ($option) must be of type int, string given in /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php:323

Stack trace:
#0 /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php(323): mysqli_options(Object(mysqli), 'ssl_ca', '/srv/certs/aws-...')
#1 /srv/matomo/core/Db/Adapter/Mysqli.php(81): Zend_Db_Adapter_Mysqli->_connect()
#2 /srv/matomo/libs/Zend/Db/Adapter/Abstract.php(315): Piwik\Db\Adapter\Mysqli->_connect()
#3 /srv/matomo/core/Db/Adapter.php(51): Zend_Db_Adapter_Abstract->getConnection()
#4 /srv/matomo/core/Db.php(156): Piwik\Db\Adapter::factory('MYSQLI', Array)
#5 /srv/matomo/core/Db.php(55): Piwik\Db::createDatabaseObject()
#6 /srv/matomo/core/Db.php(297): Piwik\Db::get()
#7 /srv/matomo/core/Option.php(288): Piwik\Db::fetchAll('SELECT option_v...')
#8 /srv/matomo/core/Option.php(178): Piwik\Option->autoload()
#9 /srv/matomo/core/Option.php(48): Piwik\Option->getValue('branding_use_cu...')
#10 /srv/matomo/plugins/CoreAdminHome/CustomLogo.php(53): Piwik\Option::get('branding_use_cu...')
#11 /srv/matomo/plugins/CoreAdminHome/CustomLogo.php(68): Piwik\Plugins\CoreAdminHome\CustomLogo->isEnabled()
#12 /srv/matomo/core/ExceptionHandler.php(126): Piwik\Plugins\CoreAdminHome\CustomLogo->hasSVGLogo()
#13 /srv/matomo/core/ExceptionHandler.php(90): Piwik\ExceptionHandler::getErrorResponse(Object(TypeError))
#14 /srv/matomo/core/ExceptionHandler.php(42): Piwik\ExceptionHandler::dieWithHtmlErrorPage(Object(TypeError))
#15 [internal function]: Piwik\ExceptionHandler::handleException(Object(TypeError))
#16 {main}
  thrown in /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php on line 323

Possible Solution

Comment line 323 in file /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php

Steps to Reproduce (for Bugs)

  1. Use MySQL SSL config with MySQLi driver
adapter = "MYSQLI"
enable_ssl = 1
ssl_ca = "/srv/certs/aws-ca.crt"

Your Environment

  • Matomo Version: 4.3.1
  • PHP Version: 8.0.8
  • Server Operating System: CentOS 7
  • Additionally installed plugins: None
@robinverstrepen robinverstrepen added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jul 17, 2021
@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jul 18, 2021
@diosmosis diosmosis added this to the 4.4.0 milestone Jul 18, 2021
@diosmosis
Copy link
Member

Hi @robinverstrepen, sorry you're experiencing this. Can you apply #17788 and see if it fixes the issue for you?

@robinverstrepen
Copy link
Author

I've applied the fix and everything is working when enabling SSL. Thank you for your help.

@mattab mattab changed the title HTTP 500 when enabling MySQL SSL on PHP 8.0 in PHP 8.0, when enabling MySQL SSL, got a HTTP 500 Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
2 participants