Reputation: 2323
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
Upvotes: 0
Views: 4064
Reputation: 4965
post_max_size and upload_max_filesize are directives you can set to configure your PHP setup, so they don’t depend on the PHP framework you might use.
You can set the values in php.ini, .htaccess, httpd.conf or .user.ini
php.ini example:
post_max_size=15M
upload_max_filesize=15M
.htaccess example:
php_value post_max_size=15M
php_value upload_max_filesize=15M
httpd.conf example:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html/example/
ErrorLog /var/log/httpd/error.log
<Directory /var/www/html/example/>
AllowOverride None
<IfModule mod_php5.c>
php_value post_max_size=15M
php_value upload_max_filesize=15M
</IfModule>
</Directory>
</VirtualHost>
Upvotes: 1
Reputation: 1685
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');
Upvotes: 1