Laravel catch PostTooLargeException

  Hey guys,now i am writing blog for this new concept related to error     -  Illuminate\Http\Exceptions\PostTooLargeException OR PostTooLargeException ERROR

This type of error faces at that time when you upload maximum file size upload in laravel project. For that, you need to set up some configuration in your php.ini file.

For solution of Illuminate\Http\Exceptions\PostTooLargeException, follow the below all steps:

Step1: First check your PHP Version

php -v

Step2: The command below will display your server/local php.ini file

php -i | grep php.ini

Step3: edit that file of path using below command

sudo nano /etc/php/7.2/fpm/php.ini

Please copy your path, not my path, copy you path of PC when you apply step2 command it will show you the path of php.ini file

Step4: open file using above command and using ctr+w you can find below the line and modify the value

post_max_size = 2048M/1024M                                                                                                         

upload_max_filesize = 2048M/1024M

Step5: Apply below command

sudo service apache2 restart

That's it. :)
You can follow the above steps and it will help you to solve this - Illuminate\Http\Exceptions\PostTooLargeException issue in laravel project.
I hope these steps will help you a lot.

Post a Comment

Previous Post Next Post