beyondcode / herd-community

87 stars 1 forks source link

[Bug]: Got Request Entity Too Large when uploading file more than 128mb #248

Closed handhikadj closed 11 months ago

handhikadj commented 11 months ago

Operating system version

MacOS Ventura 13.0

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.3.1

PHP Version

PHP 8.1

Bug description

Got Request Entity Too Large when uploading a file more than 128mb

already increase sizes on config files (nginx, php.ini, and herd setting) and run herd restart, still doesn't work

image

I also can see on phpinfo() , the post_max_size and upload_max_filesize is still 128M . it's still like not reflected

php.ini:

curl.cainfo=/Users/me/Library/Application Support/Herd/config/php/cacert.pem
openssl.cafile=/Users/me/Library/Application Support/Herd/config/php/cacert.pem
pcre.jit=0
post_max_size = 1000M
memory_limit=1000M
upload_max_filesize=1000M

Steps to reproduce

  1. create <input type "file" /> on html
  2. upload file more than 128mb (I'm actually getting this on Laravel Nova on File field)

Relevant log output

No response

benmAltDesign commented 11 months ago

Happening here too. I thought this would be some kind of legacy issue from Valet so I did a --force uninstall on Valet, restarted my mac but nothing here. I've confirmed in phpinfo() that the php.ini being used is the herd one and I've set the file upload to 1gb which should be easily enough for the files I'm working with.

benmAltDesign commented 11 months ago

Operating system version

MacOS Ventura 13.0

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.3.1

PHP Version

PHP 8.1

Bug description

Got Request Entity Too Large when uploading a file more than 128mb

already increase sizes on config files (nginx, php.ini, and herd setting) and run herd restart, still doesn't work

image

I also can see on phpinfo() , the post_max_size and upload_max_filesize is still 128M . it's still like not reflected

php.ini:

curl.cainfo=/Users/me/Library/Application Support/Herd/config/php/cacert.pem
openssl.cafile=/Users/me/Library/Application Support/Herd/config/php/cacert.pem
pcre.jit=0
post_max_size = 1000M
memory_limit=1000M
upload_max_filesize=1000M

Steps to reproduce

  1. create <input type "file" /> on html
  2. upload file more than 128mb (I'm actually getting this on Laravel Nova on File field)

Relevant log output

No response

I tried installing PHP 8.3 and setting the .ini for that and it seemed to work there. You wouldn't happen to have been running Valet before would you because that's what I was doing and 8.2 aint playing for me

benmAltDesign commented 11 months ago

@handhikadj Has this been fixed in a new version?

tyroga commented 9 months ago

Wait OP closed this one without a fix? I am having this issue too.

Fresh Herd Install to try and resolve but still no fix.

Warning: POST Content-Length of 190108252 bytes exceeds the limit of 134217728 bytes in Unknown on line 0

My php.ini (the one Herd uses)

curl.cainfo=/Users/[username]/Library/Application Support/Herd/config/php/cacert.pem
openssl.cafile=/Users/[username]/Library/Application Support/Herd/config/php/cacert.pem
pcre.jit=0
output_buffering=4096

memory_limit=512M
upload_max_filesize=500M
post_max_size=500M

But still reads as 128M in phpinfo and can't upload files above 128MB. 😵‍💫

MacOS 14.2.1 (23C71) PHP 8.2.15 Herd 1.3.(build 19)

Herd settings : Max file upload size: 500 Memory Limit: 512

Anyone got a fix?

mpociot commented 9 months ago

Can you check your FPM configuration? The value could be overwritten there

tyroga commented 9 months ago

Thanks Marcel

This is what I have:

Screenshot 2024-01-26 at 4 05 15 pm Screenshot 2024-01-26 at 4 07 26 pm

Am I looking in the right place? I recently uninstalled and reinstalled Herd trying to fix another issue with a site, was able to upload large files before that... now it doesn't seem to want to let me set these values via php.ini

mpociot commented 9 months ago

Please check the config file in ~/Library/Application Support/Herd/config/fpm

tyroga commented 9 months ago

OMGoodness I didn't know that it used a different config file other than the ini. 🤦‍♂️

Maybe https://herd.laravel.com/docs/1/advanced-usage/php-settings could be updated to reflect this?

Thanks so much for letting me know.

handhikadj commented 9 months ago

sorry that I closed this without a comment. at that time, I'm getting nginx error that says something along this line: "the phpfpm.sock already running". seemed the phpfpm was conflicting. I fixed it and this fixed this issue

alancwoo commented 2 months ago

Please check the config file in ~/Library/Application Support/Herd/config/fpm

I was really struggling to configure this as well and this finally solved it - but I don't understand why it was necessary still. The 8.2-fpm.conf specifically mentions When uncommented, the following values will take precedence over settings declared elsewhere and were uncommented, so nothing was being modified there.

So why is the loaded php.ini as configured by both the Herd GUI and also in the file itself not respected? In my case it was stuck at 2M in all cases.