Editing a php.ini that PHP never reads is a classic way to lose an evening. Before I change a setting, I’d rather ask PHP which files it uses. The answer is one flag away.
php --ini
The manual describes it as showing configuration file names and scanned directories. On a Debian-style PHP 8.3.6 install the output starts like this:
Configuration File (php.ini) Path: /etc/php/8.3/cli
Loaded Configuration File: /etc/php/8.3/cli/php.ini
Scan for additional .ini files in: /etc/php/8.3/cli/conf.d
Additional .ini files parsed: /etc/php/8.3/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.3/cli/conf.d/10-opcache.ini,
...
The list continues with one file per extension on that machine. Those small files are where distributions put extension settings, and a value in a later file can override the main php.ini. That is why checking only the main file isn’t enough.
For a clean baseline, combine it with -n, which ignores php.ini completely:
php -n --ini
On the same machine that printed Loaded Configuration File: (none) and no scanned directory entries, which confirms nothing is read.
Caveat: this tells you about the command-line binary you ran. A web server’s PHP, such as PHP-FPM or Apache’s module, can be configured with another set of files, so for WordPress on the web I’d also check phpinfo() or the Site Health info screen. The manual also mentions --ini=diff, which shows the differences from the default configuration, but only from PHP 8.5.0. It was not available on 8.3.6, so I haven’t shown any output for it.
Further reading: PHP manual: command line options