xxxxxxxxxx
if you're using 'brew php' then, as happened to me this morning, a brew update may upgrade you from 8.1 to the newly released 8.2, in which case:
valet use php@8.1
…is the simple fix.
which means old version of php will fix the issue.
xxxxxxxxxx
fastcgi_buffering on;
fastcgi_buffers 4 256k;
fastcgi_buffer_size 128k;