lewis4u lewis4u - 1 year ago 167
PHP Question

Laravel - TokenMismatchException in VerifyCsrfToken because of upload filesize

I have found that i need to change these settings in order to upload bigger files

I have changed these settings in my php.ini file

upload_max_filesize = 32M
max_file_uploads = 20

and this in my nginx.conf file

client_max_body_size 40m;

but i still get this error:

PHP Warning: POST Content-Length of 27772457 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

This is 8MB limit....but where...i have restarted my machine and it still doesn't work

Where else can i adjust the file upload limit?

Answer Source

in your php.ini you should also change your


and make it larger than your upload_max_filesize

for exemple i use :

post_max_size = 125M
upload_max_filesize = 100M

then restart php-fpm

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download