skip to Main Content

I’m try to upload 26Mb file. But I’m getting Illuminate Http Exceptions PostTooLargeException. I changed php.ini file and restart nginx, fpm

In my server after running this command I’m getting 250M

php -i | grep "post_max"
post_max_size => 250M => 250M

But my php.ini shows post_max_size 8M

I restrt nginx and fpm but nothing works

I’m still getting this error

Illuminate  Http  Exceptions  PostTooLargeException

2

Answers


  1. First, check your php version

    php --version 
    
    
    PHP 7.2.7-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 22 2018 08:44:50) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.7-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    if your php version is 7.2
    

    open this file /etc/php/7.2/fpm/php.ini

    Update these 2 fields to something that big enough. Ex. 1024M or 2048M

    post_max_size = 1024M                                                                                                            
    upload_max_filesize = 1024M  
    Restart the php
    
    service php7.2-fpm restart
    
    Login or Signup to reply.
  2. as you have setup in php upload size you should also update in nginx config

    client_max_body_size 250M;
    

    then restart nginx sudo servicve restart nginx

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search