Clarification on customizing PHP

I’m using PHP-FPM with Apache for my Nextcloud instance. I have made modifications to the php.ini file under /fpm/php.ini. Do I need to replicate those for /apache2/php.ini and /cli/php.ini as well? I wasn’t sure how all of these php.ini files are being utilized. Any understanding is welcome.

If your using occ command then yes I advice to replicate to cli/php.ini as well

occ uses the command line php cli/php.ini

apache uses the apache2/php.ini

and the fpm module uses fpm/php.ini

they can all be set separately.

1 Like

These are the different PHP SAPI’s (Server API’s). When your apache2 is configured to use the Fast Process Manager (FPM) then you can safely apt purge the apache2-mod-php.

You can see, what php-sapi is used by your apache2 with this command:

apachectl -tD DUMP_INCLUDES | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p'

If you need those changes you made to the php.ini for php-fpm in the php.ini for php-cli as well, depends on the individual setting but it is safe, to sync those php.ini files. You can not break anything.

Much luck,