php.ini settings not updating

Posted July 17, 2021 172 views
PHPWordPressUbuntu 20.04

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 uploadmaxfilesize = 20M

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.

Submit an Answer
1 answer

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:

  • <?php
  • phpinfo();

Then check for the current value of uploadmaxfilesize 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!