Installing OpenEMR 5.0.1 on Centos 7 x64

Hi all, I’m new to the forums and hope I’m posting in the correct category. (Which I just changed to Management & Admin since I didn’t see that before, sorry.)

The short story is that I’m having trouble getting MariaDB to work properly with PHP 7 & OpenEMR 5.0.1 on CentOS 7. The long story is this:

I’m pretty new to OpenEMR (and still pretty new to Linux too), and have only used 5.0.0 a little before 5.0.1 came out. When I upgraded, OpenEMR quit working because 5.0.1 requires PHP version 5.6.x - 7.2.x, and the official Centos repo only has PHP 5.5. :expressionless:

I backed up my data before upgrading, so I’m not too worried about that - and being new to OpenEMR it won’t be a total loss if I have to start from scratch either.

Anyway, I screwed up yum somehow (the Centos package installer), so I wiped the system and reinstalled fresh. I’m running CentOS 7 x64, and did a yum update before trying anything else. After lots of online searching, I got PHP 7.1 installed by following the guide at https://wiki.centos.org/HowTos/php7 (including creating the file fpm.conf to redirect PHP requests, but did NOT change the default port), and the package requirements listed at https://www.open-emr.org/wiki/index.php/OpenEMR_System_Architecture#CentOS . I got PHP 7.1 working, and confirmed it by visiting localhost/phpinfo.php and saw the pretty PHP version info. Joy! :slight_smile:

I also downloaded the latest Patch (#2, new today) and extracted it into the openemr folder. But something is still wrong. When I visit localhost/openemr/ I get an “Index of /openemr” directory page instead of the OpenEMR setup screen. When I visit localhost/openemr/sql_patch.php it says “Check that mysqld is running.” This eventually led me to /usr/libexec/mysqld, which complains that it “Can’t create test file /var/lib/mysql/localhost.lower-test” and “…The error means mysqld does not have the access rights to the directory.” I’ve never seen this error before. (I also tried running it as root, and it said that was a bad idea so I backed off.)

I verified that the path /var/lib/mysql/ exists, but there’s no file localhost.lower-test. How can I grant the needed access to MariaDB?

If you need more information, please let me know. Also, please give any relevant instructions on how to obtain the requested information. I really don’t know exactly what I’m doing yet, and a lot of this has been guesswork + Google. :wink:

Once I get this all sorted out, I’ll contribute an update to the wiki for the other Centos 7 users.

nice post @Tim, have you tried changing DirectoryIndex index.php index.html in the apache config? you could try to login in to your mysql instance from the command line to debug the mariadb issue

@jesdynf or @toolbox Would it make sense for this user to consider our Docker solution?

-Matthew

1 Like

I’d definitely say so. Its great for situations where you don’t want to wrestle with the package manager to match php versions or write Apache config spells. @jesdynf has put together a manual strategy for doing the necessary db upgrade (I recommend just restoring your db to 5.0.0 and then following those exactly to get to 5.0.1). It’s taken longer than it should have, but I’m working on an automated pathway for that as well.
Hopefully helpful!

Oh, sure. My Lightsail script is the exact letter-perfect directions to get Docker running on Ubuntu 16.04, but there’s no particular sorcery to it – get Docker, get OpenEMR, do things. If you want to use containerized OpenEMR with the host’s local DB instead of a paired container, that’s what all those envvars are for.

Thanks for all the replies!

@stephenwaite, how would I do that? Is there a guide I can reference? I only know that apache is a server application - I don’t know anything about working with it. Also, my computer is quite old and the less software I need to introduce to it the better. This, I think, would be my preferred solution.

Others (sorry - new users can only mention 2 people): thanks for the Docker tip. I’ll look into it. I’m not comfortable with trusting my patient’s information to a 3rd party cloud, so if it is a cloud technology (which my at-a-glance reading seems to indicate) then I’m going to stay away from it. One of the major draws for me is that I can run OpenEMR as a stand-alone or local-network only setup and NOT get involved in cloud stuff. But again, I need to read up on it.

@jesdynf, if I go the Docker route, where would I find your guide? I assume CentOS will be different than Ubuntu, but I’m pretty sure I can translate it for myself.

See openemr-devops/packages/lightsail at master · openemr/openemr-devops · GitHub for my AWS Lightsail install, which converts any Ubuntu 16.04 instance to a functional OpenEMR instance via a pair of Docker containers. The docker-compose.prod.yml file is the most relevant part of it for your needs, I think.

hi @Tim, you might want to dial apache back and just load the php module instead of trying to run fpm which is pretty cutting edge for a maiden voyage :slight_smile:

@stephenwaite, how would I do that? I’m good at following guides, but there’s a lot of fundamentals that I still don’t really understand yet. As I understand it, my php7 module is in a different path than the default one.

I may have changed the DirectoryIndex. At least, I edited /etc/httpd/conf/httpd.conf according to the CentOS PDF (https://www.open-emr.org/wiki/images/1/16/Configuration_Cookbook_For_OpenEMR_Using_Red_Hat’s_Free_CentOS-7_Operating_System_1st_Ed.pdf) and added index.php to one of its lines that also had index.html. (I’m not in the office right now, so I’m not sure what the line was for.) If that wasn’t what you were asking above, then can you point me in the right direction?

EDIT:
Looks like that was the DirectoryIndex that I modified. Here’s the current code block:

< IfModule dir_module>
DirectoryIndex index.html index.php
< /IfModule>

Obviously there’s no space between < and IfModule, but I had to add a space so it would appear in my post.

hi @Tim, i’m not familiar enough with centos to provide any more recs. My advice is to follow the experts suggestions above and try the docker route. It’s the future and the future is now :slight_smile:

Okay, thanks anyway. And thanks to everyone else!

I’m going to try the Docker route. Or maybe I’ll finally try out a Raspberry Pi. :wink:

In case anyone cares, since the last post I’ve tried a lot of ways to get the latest OpenEMR supported on Centos 7. I ultimately failed, although I’m sure it’s possible - I just couldn’t navigate it.

I did look into Docker. I still don’t really understand what it is or how to access it. I got it installed, but couldn’t figure out their container system. I’m thinking I need to setup an online account, but that’s precisely what I want to avoid. I’m personally not comfortable with trusting patient data to any third-party cloud, which is the entire reason for me using OpenEMR in the first place.

In the end, I decided I just needed an operating system that would support OpenEMR without going through dependency hell, and that’s how I found Linux Mint (Cinnamon desktop). It works like a charm on my old system, installing OpenEMR was ridiculously easy, and it’s actually much snappier than CentOS was. Win! :slight_smile:

2 Likes