Adodb-mysql_log.inc.php

hi @gutiersa,
I don’t think I have ever seen a successful report of OpenEMR working with nginx/php-fpm (If anybody has done this, then please let us know), so I am guessing that is the issue. Recommend using apache/php (although it would be really cool to work out how to get OpenEMR to work with nginx/php-fpm).
-brady

However, when I try to create a new site, openemr is able to connect to the database and create a new empty database. The setup script then stops and sends this message:

"
OpenEMR Setup

Step 3

Configuring OpenEMR…

Connecting to MySQL Server… OK.
Dumping source database… OK.
Creating site directory…OK.
Creating database… OK.
Creating user with permissions for database… OK.
Reconnecting as new user… OK.
unable to execute SQL: ‘SET @@SESSION.SQL_LOG_BIN= 0’ due to: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
"
Hence the setup script is able to connect to mysql.

Sandra

@brady.miller

I have to get it working this way. My apache server broke down and I could not fix it. Then I tried to reinstall it but I kept getting the same memory leak problem. The thing is that I really like nginx/php-fpm. I don’t mind continuing to try.

So the next time I try to set up a new site, using root as the secure user, this happens:

"
OpenEMR Setup

Step 3

Configuring OpenEMR…

Connecting to MySQL Server… OK.
Dumping source database… OK.
Creating site directory…OK.
Creating database… OK.
Creating user with permissions for database… OK.
Reconnecting as new user… OK.
unable to execute SQL: ‘SET @@SESSION.SQL_LOG_BIN= 0’ due to: Cannot modify @@session.sql_log_bin inside a transaction
"

Sandra

Hi @gutiersa ,

You could incur a lot of pain and lonely problem solving with this approach (since none of us use that environment), although it would be nice to see that work. I honestly can’t even predict where you will see problems on that environment. Would dockers be an option for you(this has apache/php already configured in the openemr docker)?

-brady

@brady.miller
yes, I guess. But I am not familiar with Docker. The thing is that I really enjoy freeBSD. It is just such a cool OS.
I will look into it.
My goal is to set up a server that can handle many connections. I am very frustrated with the EMR my company is using now. I truly dislike it. It is very aggravating.
I will look into it though.
I had openemr working at one point, though. I was able to add patients.

Sandra

hi @gutiersa ,

Dockers are simply awesome :slight_smile: In an effort to try to convince you, check out this post where you can set up a openemr demo in a matter of a minute or so:

That you had OpenEMR working at one point, though, with nginx/php-fpm is also very enticing.

-brady

@brady.miller
ha ha, yes, very interesting. However, is it free and opensource??
I will try it.
Sandra

PS: wouldn’t it be great to get openemr working well with php72 and mysql80??

I see that there is an option for error logging in globals.php. I would like more information. Is there a document?
Where is the log?

@brady.miller
Wow, that was quite beautiful. But can I run my EMR from docker? Or is this intended strictly as a demo?

Sandra

Hi @gutiersa ,

Regarding php7.2 and mysql8:
This is another win for dockers.

OpenEMR 5.0.1 is compatible with PHP 7.2 , which was much easier for us to make compatible because of the demo farm (which uses dockers) having demos for PHP 7.2 here:
Ubuntu 18.04 with PHP 7.2 openemr demo
Alpine Edge with PHP 7.2 openemr demo

OpenEMR 5.0.1 with patch 3 is compatible with mysql-8
Note mysql8 breaks installation, so need to await the new 5.0.1 builds (that will have patch 3 in them); at this point only the 5.0.1 docker has patch 3 in it. The only caveat is that need to set default-authentication-plugin=mysql_native_password in the mysql8 server.

Note that getting mysql8 to even work was made much easier with dockers, since I used the docker development environment (this allows use to test code on php 7.1/7.2(with and without ssl) and all 9 supported version of mysql/mariadb):
openemr/README.md at master · openemr/openemr · GitHub

As an aside, after going through above mysql8 work, it really looks like mariadb and mysql are beginning to diverge, which is interesting. For example, mariadb 10.3 (their soon to be released version) does not require the default-authentication crud and does not reserve groups and does still allow creating a user and granting permissions at the same time (note these were the 3 issues that needed to be addressed to support mysql8).

Regarding globals.php error log:
Which line in globals.php are you referring to? If I know that, I can provide more background on it.

Regarding docker for your emr
Heck yes. Note that 4 of the 5 AWS Cloud offerings and the Appliance are using dockers. Recommend installing docker and docker-compose on your computer and playing around with it. For example, here is a docker compose I just created that should get you started with openemr, mysql (version 8 at that), and phpmyadmin:
https://gist.github.com/bradymiller/a882618169f61b7316e4ad4067cf69eb

Which you can test it quickly here:
Try it!

If you take this script locally and rename it to docker-compose.yml, then in same directory do:
docker-compose up -d
Then it will build it for you (takes a minute or so)
And then you can tear it all down with (delete everything) with:
docker-compose down -v

To give you a visual of what is happening when dockers are going, type:
docker ps -a

You can also stop them all without removing anything:
docker-compose stop
and start them
docker-compose start
And lets say you don’t want phpmyadmin going for security reasons, then
docker-compose stop phpmyadmin
and could even remove the restart: always line for phpmyadmin in docker-compose.yml to ensure it does not start when host does shutdown/restart

And the ports for each service in docker-composer.yml are where things map to; note now using 8080-8082, but can make them 80,443,8081 if wish, or anything else if wish.

The one thing you need to get used to is sometime needing to work in the docker themselves, which is easy once you figure out how to do it. You can learn more about the openemr docker here also:
https://hub.docker.com/r/openemr/openemr/

-brady

@gutiersa
Yes, it does sound very interesting. It sounds so much like Jails in FreeBSD.

It seems like the problem is in my server set up. I have already started over with a new install of openemr, and have the same problem, even though I am able to set up a whole new site with multisite = true. So the connection and driver are all good. The problem is with my nginx configuration. I am looking into that now.

Let me ask you, is the md5sum listed in the downloads page accurate? I keep getting the same md5sum, even after downloading it multiple times, but not the one listed.

Sandra

md5sum should be accurate, but it is manually done and added, so we could be mistaken. Which file is this?

@brady.miller

openemr-5.0.1.tar.gz

hi @gutiersa,

Most recent should be:
e37655f9480157c7a0817b3082ea88c7
(Note this is the most recent package with patch 1)

The prior package before patch 1 build was:
c871b0ad97003e4e1dc1b925fb1f12ef

-brady

@brady.miller
This is what I get in the error log:

"
2018/06/03 11:29:33 [error] 30554#101333: *54 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to a member function PConnect() on boolean in /path/to/openemr/library/authentication/privDB.php:52
Stack trace:
#0 /path/to/openemr/library/authentication/privDB.php(71): getPrivDB()
#1 /path/to/openemr/library/authentication/privDB.php(102): privStatement(’ SELECT id,pass…’, Array)
#2 /path/to/openemr/library/authentication/login_operations.php(49): privQuery(’ SELECT id,pass…’, Array)
#3 /path/to/openemr/library/auth.inc(47): validate_user_password(‘admin’, ‘pass’, ‘Default’)
#4 /path/to/openemr/interface/globals.php(567): include_once(’/path/to/ope…’)
#5 /path/to/openemr/interface/main/main_screen.php(25): require_once(’/path/to/ope…’)
#6 {main}
thrown in /path/to/openemr/library/authentication/privDB.ph” while reading response header from upstream, client: xx.xx.xx.xx, server: domain.name, request: “POST /interface/main/main_screen.php?auth=login&site=default HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm.sock:”, host: “domain.name”, referrer: “https://domain.name/interface/login/login.php?site=default
"

sandra

@brady.miller

I think the file that generates: adodb-mysql_log.inc is privDB.php in library/authentication. Check out line 51:

$GLOBALS[PRIV_DB]=NewADOConnection(“mysql_log”);

Could this be it?

Sandra

hi,

That code should not ever be called unless using the secure_sqlconf.php which I do not think anybody uses (this was something a developer did in the past to make certain mysql tables more secure and requires lots of configuration). i also realized that there is a bug there anyways, and should instead be (the mysql should be mysqli):
$GLOBALS[PRIV_DB]=NewADOConnection(“mysqli_log”);

Try that change and see what happens.

-brady

Well, but I did have the file in default. removing the file doesn’t help anyway.

OMG, it worked, it should be mysqli_log

Cool

Crazy. That section of code should never be called. I am going to do a blind fix there (there are changes that are needed for mysqli and mysql ssl support); figured that is better than leaving it known as being broken.
-brady

someone else is having this problem. yes fix please.