OpenEMR v7.0.4 Port for FreeBSD 15 w/ Support for Running on httpd with CGI and PHP-FPM

Hello all!

Happy to share that I've finished making a port of OpenEMR that runs natively on FreeBSD 15 via statically compiled binaries (and a few bundled libs).

OpenEMR is the world's most popular open-source medical record and is used around the world in real healthcare situations. I was interested in making a port for FreeBSD because I knew the OS had a legacy of serving high amounts of traffic, reliably.

The latest build I've released can be found here and contains the following files ...
  1. openemr-v7_0_4.phar - OpenEMR source code for tag 7_0_4 as a PHP PHAR.
  2. php-cgi-v7_0_4-freebsd-arm64 - PHP 8.5 CGI binary compiled with all the extensions necessary to run OpenEMR.
  3. php-cli-v7_0_4-freebsd-arm64 - PHP 8.5 CLI binary compiled with all the extensions necessary to run OpenEMR.
  4. php-fpm-v7_0_4-freebsd-arm64 - PHP 8.5 FPM binary compiled with all the extensions necessary to run OpenEMR.
I've also made a build script that's designed to run on macOS and orchestrates the build by running an Expect script that coordinates actions in a QEMU VM running FreeBSD 15.

I've also put together examples showing running OpenEMR with ...

  1. The development server built into the PHP CLI binary (both in a QEMU VM and natively)
  2. Apache using a CGI interface with a PHP 8.5 CGI binary running in a QEMU VM and orchestrated from macOS.
  3. Apache using PHP-FPM with a PHP 8.5 FPM binary running in a QEMU VM and orchestrated from macOS.
The build script is entirely customizable and I also took this GIF recording of the build process using Terminalizer that can be found embeded at the top of the build guide which can be found here. You can see in the recording of the build process that it starts in a macOS terminal and then switches over to FreeBSD shortly after I finish downloading the FreeBSD 15 VM image and it starts running it QEMU.

If anyone has any chance to benchmark the setups or independently reproduce the builds I’d greatly appreciate any feedback. My hope is that these builds can be good options for users operating in high performance settings where the efficiency and performance gains you get from using a statically compiled version of PHP (or something very close to it because I do bundle a few libraries to make it work) and by running on bare metal without the need for virtualizing an OS with Docker will do some good. Also I'd be really excited if anyone was able to get a setup running in a Jail or with Bhyve!

Hope this message finds everyone well!
 
Back
Top