php 7 php.ini upload_max_filesize not working

CuongDC picture CuongDC · May 23, 2016 · Viewed 52.6k times · Source

I have read many solutions on internet , but still cannot change upload_max_filesize value (upload_max_filesize always = 2M )

here is my loaded php.ini in phpinfo() :

Configuration File (php.ini) Path         /etc/php/7.0/apache2
Loaded Configuration File                    /etc/php/7.0/apache2/php.ini
Scan this dir for additional .ini files      /etc/php/7.0/apache2/conf.d 
upload_max_filesize 2M  2M
post_max_size   8M  8M

here is my edited php.ini in /etc/php/7.0/apache2/php.ini

; http://php.net/post-max-size
post_max_size = 86M
; http://php.net/upload-max-filesize
upload_max_filesize = 40M

im using ubuntu 14.04,apache2,php7.0 (I have reset apache2 many time after each change in php.ini )

Answer

Sandy picture Sandy · Feb 3, 2018

I had a fix for PHP-FPM 7.1

Edit your php.ini in

/etc/php/7.1/fpm/php.ini

Make changes to whatever option you want like, post_max_size, upload_max_filesize, max_execution_time & so...

save & close file.

run

sudo service php7.1-fpm restart

It will work!