Stack: laravel7.0.8 + nginx 1.14.2
I cannot upload files bigger than 1MB, files less than 1MB are uploaded successfully.
nginx log does not show anything useful
laravel log is empty
In laravel at my controller endpoint I die and dump the validated data. If the file is less than 1 MB I get the dd() printout as expected. If the uploaded file is larger and 1MB no dd() message is displayed, the browser 'flashes' no page reload is initiated.
I tried the following, without success:
In the /etc/nginx/nginx.conf I added client_max_body_size 100M;
Then ran: nginx -s reload && nginx service restart
So my questions:
Is there anything else I can do to change the max body size ?
Are there a way to check any logs that can point in the right direction ?
Solved it by updating the php.ini file on the server.
In the php.ini the following parameters have to be changed:
If those three are not updated accordingly Laravel does not recognize the file and file related functions do not work.
When running nginx the php.ini file can be found by running the command:
On nginx look for php-fpm.conf This is the file which has to be updated.
In order for the changes to be loaded the process has to be reloaded. On Debian the command is:
You will have to see what is the name of your php process. To see all process and find you php process you can use: