Apache mod_php and php-fpm are not the same deployment

Moving from Apache with mod_php to nginx with php-fpm changes where PHP runs, which user it runs as, and which configuration file it reads — and each of those has surprised somebody at two in the morning.

# mod_php: PHP is inside the Apache process
$ php -i | grep 'Loaded Configuration'
/etc/php/7.2/apache2/php.ini

# php-fpm: a separate pool, separate ini, separate user
$ php -i | grep 'Loaded Configuration'
/etc/php/7.2/cli/php.ini          # not what the web requests use
$ php-fpm7.2 -i | grep 'Loaded Configuration'
/etc/php/7.2/fpm/php.ini

Three php.ini files with different values is the norm rather than an accident, and editing the CLI one while debugging a web request is a rite of passage. .htaccess directives setting PHP values stop working entirely under fpm, which is the migration surprise that breaks upload limits and error display on a site that was fine for years. Apache with mod_proxy_fcgi is the middle path and keeps the rewrite rules while moving PHP out of the web server.