Serving PHP the multi-threaded way

Logos for Apache, PHP, and FreeBSD.
Logos for Apache, PHP, and FreeBSD.

By default, Apache 2.4 on FreeBSD uses the prefork MPM (Multi-Processing Module), which is non-threaded. This is fine in many cases and offers the most compatibility, but the threaded event and worker MPMs provide better performance on most systems. However, since PHP is not thread-safe without extra compilation options, the traditional mod_php (PHP as an Apache module) method is only compatible with prefork. PHP-FPM (FastCGI Process Manager) is an alternative that provides a CGI daemon that can be used by threaded versions of Apache and offers its own performance benefits over mod_php.

This guide assumes you have a fresh installation…

Cody Logan

I’m just this guy, you know?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store