Small file get uploaded but not large file in Laravel

后端 未结 6 1526
無奈伤痛
無奈伤痛 2020-12-09 09:28

I have this action in controler

    public function upload() {
  // getting all of the post data
  $file = array(\'image\' => Input::file(\'image\'));
  /         


        
6条回答
  •  感动是毒
    2020-12-09 09:50

    For laravel apps running on nginx..

    1. Identify your php ini file:

      php -i | grep php.ini

    2. Edit both the cli and the fpm files to be sure:

      vim /etc/php/7.2/cli/php.ini

      vim /etc/php/7.2/fpm/php.ini

    3. Change these to your prefered limits:

      post_max_size = 1G

      upload_max_filesize = 1G

      memory_limit = 1G

    4. Restart php fpm

      service php7.2-fpm restart

    5. Reload nginx

      service nginx reload

提交回复
热议问题