Open emr is giving the error message

Hi @adunsulag,

When I’m trying to open the login page of openemr, it is giving me this error.
Fatal error : Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, bool given in C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php:1150 Stack trace: #0 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php(1150): mysqli_query(false, 'SET NAMES ‘utf8…’, 0) #1 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\adodb.inc.php(1318): ADODB_mysqli->_query('SET NAMES ‘utf8…’, false) #2 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\adodb.inc.php(1295): ADOConnection->_Execute('SET NAMES ‘utf8…’, false) #3 C:\xampp\htdocs\openemr\library\ADODB_mysqli_log.php(60): ADOConnection->Execute('SET NAMES ‘utf8…’, false) #4 C:\xampp\htdocs\openemr\library\sql.inc(66): ADODB_mysqli_log->ExecuteNoLog('SET NAMES ‘utf8…’) #5 C:\xampp\htdocs\openemr\interface\globals.php(301): require_once(‘C:\xampp\htdocs…’) #6 C:\xampp\htdocs\openemr\interface\login\login.php(34): require_once(‘C:\xampp\htdocs…’) #7 {main} thrown in C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php on line 1150

This is the lines of code available in adodb-mysqli.inc.php file.

else {

        $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);

        if ($rs) {

            $this->isSelectStatement = is_object($rs);

            return $rs;

        }

    }

Can you please help me in resolving that?

Your database is not connecting via OpenEMR. You’ve got some kind of permission setting setup incorrectly, incorrectly configured database sqlconf.php or something setup wrong on MySQL. You’ve given no indication of your operating system, how you’ve installed OpenEMR or anything else which would be needed to assist you.

Hi @adunsulag,

I’ve installed openemr in my Windows 10 and following all the steps mentioned in the official website of openemr i.e., OpenEMR 6.1.0 Windows Installation - OpenEMR Project Wiki

I’m able to register my client in my openemr. But when I’m trying to generate the authorization token from the postman, this message is coming up at the top of the response:
Notice: Key file “file://C:/xampp/htdocs/openemr/sites/default/documents/certificates/oaprivate.key” permissions are not correct, recommend changing to 600 or 660 instead of 666 in C:\xampp\htdocs\openemr\vendor\league\oauth2-server\src\CryptKey.php on line 80

Can you please help me why it giving this message and how I can overcome with this?

Hey I am having this same problem but I have no clue how to fix it it is a constant occurrence when xampp closes suddenly what happens. I have Openemr 7 along with xampp 8.02 along with xampp I installed with the basic way but still nothing . I am trying to to have to continuously reinstall it over and over when I see this problem.

Hey did you ever fix this problem ?

Hey Guys I am trying to add soap notes from another EMR system into open emr I really need help I already altered the tables to the same format as those on open emr but nothing is showing up on the page can someone tell if it is possible to do and if so how to do it

A post was split to a new topic: Mysqli fails to connect login page 500 error

I experienced this error on my development machine when I brought in an instance of a DB that was being used on a remote machine. In my sqlconfig.php file I was using the same log-in creds from the remote machine, using the same username and password combo which did not exist on my machine.

To trouble shoot this error go into your sqlconfig.php file and temporarily use your root username and password combo. This resolved my issue.