How to edit php settings in Laravel 5.4 to accept large downloads of csv files?

I can change the maximum file upload size in php.ini in my local, but I can not do the same in Laravel 5.4. I want to download a csv 4mb file.

+3
source share
2 answers

You need to configure both your web server and PHP to increase file upload. For PHP, you want to configure upload_max_filesize and post_max_size to fit you. For instance:.

upload_max_filesize = 5M post_max_size = 8M 

For NGINX, you want to configure client_max_body_size , and for Apache you want to configure LimitRequestBody .

There are also several other configuration options in your web server configuration that may prevent you from downloading large files. See your web server manual for instructions on setting these values.

Please note that after setting these parameters you will want to restart both PHP and your web server.

0
source

Thanks for helping me. I know that php.ini file exists in PHP / Apache. If I edit this to increase the download size, it works in my local one. But my goal was to upload it to my laravel website.

After too many bumps and tests, I finally found a solution, you have to edit public / .htaccess Add this

 RewriteEngine On php_value upload_max_filesize 10M php_value post_max_size 20M php_value memory_limit 32M 

This will increase the file upload size in Laravel 5.4

I recently started using laravel and upgraded to 5.4 as soon as it was released. So, I had a lot of questions.

0
source

Source: https://habr.com/ru/post/1014460/


All Articles