Home > Software engineering >  Why is there a difference on 'ini_get_all()' versus 'php -i' and the 'php.i
Why is there a difference on 'ini_get_all()' versus 'php -i' and the 'php.i

Time:10-13

I have to increase the configuration parameter 'upload_max_filesize' within my application from 2MB to 8MB.

/etc/php/7.3/cli/php.ini

When accessing the file (within a docker container btw) or typing

php -i 

I get 8MB.

However, when dumping the value via

dump(ini_get_all());

or

dump(ini_get('upload_max_filesize'));

in my application, I still get 2MB as maximal filesize for uploads.

Is there some sort of cache or local/global conflicts?

CodePudding user response:

Because it's using different config files. /etc/php/7.3/cli/php.ini is, as the path says, for CLI. So it affects only command line usage.

Check your phpinfo() to see which config file is used in your web server environment instead! Search for "Loaded configuration file".

The exact path depends on the web server setup. For Apache it could be /etc/php/7.3/apache2/php.ini for example.

  • Related