Change db driver in 4.2.1


(Craig Sparks) #1

Situation
Our host recently upgraded to php 7.2, which has rendered OpenEMR inoperatable. The errors we are getting are related to the mysql driver. I figured since it was using ADO that it would be easy to switch it to mysqli, but it seems that there are various things in the sql.inc file that break. Is there a easy way to switch 4.2.1 to use mysqli?

OpenEMR Version
4.2.1

Browser:
I’m using: Chrome

Operating System
I’m using: Linux

Logs
PHP Fatal error: Uncaught Error: Call to undefined function mysql_pconnect()


(Stephen Waite) #2

hi @jexmex, do you have a lot of customizations? if not you can upgrade to 5.0.1 https://www.open-emr.org/wiki/index.php/OpenEMR_Downloads


(Craig Sparks) #3

There are several, I will have to evaluate what all needs to be ported. A upgrade is something that needs to be done, but it will take a bit to go through and get that all worked out before. I only work on this site every few months or less and another developer was working on it previously as well, so I want to make sure we have everything properly documented. Meanwhile, I am just trying to get it working again for the Dr to use tomorrow.


(Robert Down, BSN, RN) #4

Hi Craig,

We just dropped support for PHP <= 7.0 because PHP stopped issuing security patches. Hopefully you can work through the customizations quickly and get back up and running.

Let us know if you get stuck on anything, we’re always here to help :slight_smile:


(Brady Miller) #5

Hi @jexmex ,

In terms of resources, getting OpenEMR to be compatible with PHP7 and support mysqli was no laughing matter (ie. took tons of time/resources); I can’t even point to a specific commit since it was done in many commits over half a year or so. You will spend much less time upgrading your OpenEMR to 5.0.1.

-brady