php.ini settings not updating

Running LAMP with a WordPress installation. I’ve updated my php.ini file under /etc/php/8.0/cli/php.ini and /etc/php/8.0/cli/php.ini and /etc/php/7.4/cli/php.ini, as well as added information to my WP php.ini and .htaccess and I’m still seeing the value as 2MB instead of the 20MB that I require.

I’ve run php -i | grep php.ini and get

Configuration File (php.ini) Path => /etc/php/8.0/cli
Loaded Configuration File => /etc/php/8.0/cli/php.ini

I just can’t figure out why it’s not updating the upload_max_filesize = 20M


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @eastonparkwiki

In order to make sure that you’re updating the correct php.ini file you can create a phpinfo file and check the loaded configuration file.

You can create a file named info.php (the name doesn’t really matter) and put the following content in the file:

  1. <?php
  2. phpinfo();

Then check for the current value of upload_max_filesize and also check which is the configuration file - php.ini that is currently used.

Then you can apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites).

upload_max_filesize = 64M

Hope this helps! Regards, Alex