Skip to content

post_max_size evaluates .user.ini too late in php-fpm? #8157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thirsch opened this issue Feb 28, 2022 · 3 comments
Open

post_max_size evaluates .user.ini too late in php-fpm? #8157

thirsch opened this issue Feb 28, 2022 · 3 comments

Comments

@thirsch
Copy link

thirsch commented Feb 28, 2022

Description

We are trying to modify the value for post_max_size per directory through a .user.ini-file running on php-fpm behind an Apache webserver using proxy_fgci_module. As mentioned in the docs, the setting should be a per-dir setting and we are able to see the correct values using $value = ini_get('post_max_size'); but sending a bigger value using the POST method results in a log message using the default value of 8M and the data is not submitted to the script:

NOTICE: PHP message: PHP Warning:  POST Content-Length of 10746083 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

By changing the value in the php.ini, it's working as expected. Also using PUT instead of POST let me pass and receive the data.

I'd guess, the POST content size is evaluated too early, before the value of the .user.ini is set?

The upload_max_filesize value is working fine and we are able to upload bigger files than the limit, only POST-requests with content bigger than 8M are affected.

PHP Version

Tested on 7.4 and 8.1

Operating System

No response

@thirsch thirsch changed the title post_max_size evaluates .user.ini to late in php-fpm post_max_size evaluates .user.ini too late in php-fpm? Feb 28, 2022
@cmb69
Copy link
Member

cmb69 commented Mar 1, 2022

That might be caused by post_max_size being a SAPI global, while upload_max_filesize is a core global. It might affect other SAPIs as well.

@cmb69 cmb69 added the SAPI: fpm label Mar 1, 2022
@cmb69
Copy link
Member

cmb69 commented Mar 8, 2022

This issue does not affect (F)CGI, so this would be an FPM only issue; however, I'm not sure what exactly is wrong, since the docs state;

These files are processed only by the CGI/FastCGI SAPI.

Either the docs are wrong (should mention FPM as well), and the setting in .user.ini should work, or the docs are right, and .user.ini should be ignored altogether by FPM.

@bukka
Copy link
Member

bukka commented Apr 23, 2022

This is basically the same as https://bugs.php.net/bug.php?id=75741 . The ordering will be most likely the issue. I have got this on my list but might take few months to get there as there are higher priority items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants