That is the php.ini from your cli SAPI. So that one only has effect for cron jobs and occ commands.
You should know, which php-SAPI is used by your webserver.
SAPI stands for “Server API” (API stands for “Application Programming Interface”). It is the mechanism that controls the interaction between the “outside world” and the PHP/Zend engine.
These are the most important SAPIs:
Command Line Interface
- term - cli
- package -
php<VER>-cli
- description:
cli is used by PHP scripts that are called from the command line. i.e. all processes that were explicitly NOT called by the web server (cron jobs, occ commands, etc.)
Apache2 module (a.k.a. Apache2 Handler)
- term - apache2
- package -
libapache2-mod-php<VER>
- description:
the apache2 module is the default SAPI for apache2. The downside is that it’s not particularly scalable and doesn’t support http2.
libapache2-mod-php relies on the old but stable Multi-Processing Module (MPM) “mpm-prefork”.
Fast Process Manager
- term - fpm
- package -
php<VER>-fpm
- description:
this is the default SAPI used by nginx.
On apache2 php-fpm relies on the more scalable threaded MPM “mpm-event”. Additionally it needs the apache2-modules “proxy_fcgi” and “setenvif”.
Every SAPI has its own php.ini file:
/etc/php/<VER>/<SAPI>/php.ini
If your webserver is apache2, you can find out the active mpm (Multi Processing Module) with this command call:
sudo apachectl -M 2>/dev/null | grep mpm
as explained above, the “mpm_event_module” means that apache2 speaks via fpm, while the “mpm_prefork_module” indicates that the apache2 module is used for the comunication between webserver and php.
Since only one mpm module can be loaded in the core of apache2, libapache2-mod-php<VER>
and php<VER>-fpm
are mutually exclusive.
You should know which of both is used to tweek the right php.ini file.
So if your webserver uses the apache2 handler, then you should tweek:
/etc/php/8.2/apache2/php.ini
while if your web server uses the Fast Process Manager, then you need to look here:
/etc/php/8.2/fpm/php.ini
h.t.h
Bon chance,
ernolf