Search code examples
phplaravelfile-uploadwamp

can't change upload_max_filesize


i have upload form at laravel 5 but i can't upload file size larger than 2M

use WAMP,window 10, and all local

i did this but nothing change:

change php.ini from "wamp64\bin\php\php5.6.25" and "wamp64\bin\php\php7.0.10"

upload_max_filesize = 100M
post_max_size = 100M

change .htaccess from my project

php_value post_max_size 2000M
php_value upload_max_filesize 2500M
php_value max_execution_time 6000000
php_value max_input_time 6000000
php_value memory_limit 2500M

chagne wamp to XAMPP and do all again but still no change. actually when i edit php.ini and htaccess everything is correct but in my project still 2M limit???!!!!

my phpinfo()

Configuration File  C:\wamp64\bin\php\php5.6.25\php.ini

and when i use this code in my project,result is :

{{ini_get('upload_max_filesize')}}  2M
{{ini_get('post_max_size')}}        8M

and yes.i'm sure edited all php.ini in my wamp folder

and yes i restart my wamp


Solution

  • You can try to change it dynamically in your PHP scripts.

    Like this :

    <?php
    ini_set('post_max_size', '2000M');
    ini_set('upload_max_filesize', '2000M');