Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php ini setting upload_max_filesize not working

I need to change upload limit to 2GB on php 7.2 Ubuntu 16.04.

As a first step, when I check /etc/php/7.2 folder I can see cli and fpm folders.

So to make sure the ini location I have print the php info using

 echo phpinfo()

And I got the output

Server API                         :   FPM/FastCGI
Virtual Directory Support          :   disabled
Configuration File (php.ini) Path  :   /etc/php/7.2/fpm
Loaded Configuration File          :   /etc/php/7.2/fpm/php.ini 

And I have edited /etc/php/7.2/fpm/php.ini with

upload_max_filesize = 2048M

And restarted the apache but using phpinfo() still it print

  upload_max_filesize   2M

So I have tried with command php -i | grep -i "loaded configuration file" but it print different configuration file,

 Loaded Configuration File => /etc/php/7.2/cli/php.ini

On this file also I have changed upload_max_filesize to 2048 and restarted the Apache and still the result is same.

What could be the problem, any help will appreciated.

like image 780
CodeDezk Avatar asked Jan 01 '23 10:01

CodeDezk


1 Answers

I got the problem resolved by the answer here Changes to upload_max_filesize in Ubuntu php.ini will not take effect.

Instead of restarting the apache I have to restart the php using

sudo service php7.2-fpm restart
like image 102
CodeDezk Avatar answered Jan 08 '23 05:01

CodeDezk