Search code examples
phpphp-7

php 7 php.ini upload_max_filesize not working


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 )


Solution

  • i fingured out !

    in my loaded php.ini config , my error_reporting values is E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED-> this is wrong!, so i changed it to

    error_reporting: E_ALL and then restart apache2 server, now everything working fine !


    so please note : if php.ini have any error , it will use default value (which means upload_max_filesize always 2M )