Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

IsaacBen's avatar

Can't upload files larger than 3MB

I edited the php.ini file. I changed both the "upload_max_size" and the "post_max_size" and restarted wamp, but I still can't upload images larger than 3MB. I get this error "TokenMismatchException in VerifyCsrfToken.php line 46:". What the problem could be? Should I just leave it like that or this problem will also appear in production?

0 likes
4 replies
jekinney's avatar

I ran into that issue to. I guessed the session expired. I used a queued job and since have not had the issue.

Kryptonit3's avatar

Make sure you are editing the right php.ini file, run this from the console

php -i | grep 'Configuration File'

or

php --ini
IsaacBen's avatar

@Kryptonit3 Yeah, I edited the right file. I tried to increase the max execution time but that didn't help. Maybe the problem comes from Laravel, should I disable the csrf?

IsaacBen's avatar

It works now for some reason. I just closed the console and opened it again.

Please or to participate in this conversation.