Tips and tricks

Is PHP-FPM better than mod_php ? Short answer…
Yes—PHP-FPM is the better choice for your stack (Homebrew Apache on macOS), mainly because it lets you run the event MPM (needed for HTTP/2 and better concurrency) while keeping PHP out of Apache’s memory space. mod_php ties you to prefork, which disables HTTP/2 and scales worse.
Below is a crisp comparison, then two complete, minimal configs: one “modern” with PHP-FPM (event, HTTP/2), and one “legacy” with mod_php (prefork).
PHP-FPM (via proxy_fcgi)
Pros
- Works with mpm_event/worker → enables HTTP/2 and better concurrency.
- Lower memory per connection (Apache threads don’t embed PHP).
- Crash isolation: PHP crashes don’t take Apache with them.
- Tunable pools per site (
pm.*
, slowlog, status/ping endpoints). - Easier upgrades (restart FPM without bouncing Apache).
Cons
- One more hop (FastCGI). Overhead is tiny, but it exists.
- You can’t use
php_value
/php_flag
in.htaccess
(use.user.ini
or FPM pool).
mod_php
Pros
- Simple “all-in-one” dev setup;
php_value
in.htaccess
just works.
Cons
- Forces mpm_prefork (no HTTP/2; worse concurrency).
- Higher memory: every Apache child loads PHP.
- PHP crash = Apache process crash.
- Falling out of favor; most stacks moved to FPM years ago.
Check which module your server is running
cat > "/{{SERVER_LOCATION}}/info.php" <<'PHP' <?php phpinfo(); PHP
curl -s -k https://{{SERVER_URI}}/info.php | grep -i 'Server API'
rm "/{{SERVER_LOCATION}}/info.php"
If it says
<tr><td class="e">Server API </td><td class="v">FPM/FastCGI </td></tr> <tr><td class="e">Server API (SAPI) Abstraction Layer </td><td class="v">Andi Gutmans, Shane Caraveo, Zeev Suraski </td></tr>
Then, it’s Server API ⇒ FPM/FastCGI → your site is running PHP-FPM behind Apache (via proxy_fcgi
), not mod_php.