-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use CONTEXT_DOCUMENT_ROOT for scanning dir tree #5051
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
Conversation
Looks reasonable to me for |
* If CONTEXT_DOCUMENT_ROOT is set use that rather than DOCUMENT_ROOT to scan up the dir tree looking for .user.ini files.
Okay, I've rebased my |
Just noticed this. Can someone tell why was this was add it to php-fpm (just noticed that in changes for 8.0)? This is just CGI, right so this shouldn't impact fastcgi. Please let me know. Otherwise I will remove the FPM specific changes. |
CC @Ragnoroct @nikic |
I don't think cgi vs fcgi makes a difference here. Not sure whether it's relevant for fpm specifically though. |
Ok it looks that Apache actually passes that variable. I guess it probably makes some sense. |
I mean it sets it for fcgi as well... |
The bug report said it was happening on PHP-CGI. I've also experienced it on fcgi. |
I'm not sure what the question is. |
It looks like using CONTEXT_DOCUMENT_ROOT is not always desirable: https://bugs.php.net/bug.php?id=80113 |
What should we do in this situation? Is it possible to scan both?.. |
Can a check be introduced to see if the |
Or alternately, check if |
Yes, I think so. I'll see if I can try your script_filename solution. Is
script_filename always guaranteed to be set?
…On Thu, Oct 15, 2020, 12:03 PM wf-mattr ***@***.***> wrote:
Or alternately, check if CONTEXT_DOCUMENT_ROOT is a substring of
SCRIPT_FILENAME before choosing to use it instead of DOCUMENT_ROOT? I
don't have a site with mod_userdir to check the behavior that way, but this
would fix the sites I see with CGI configured as described in the PHP bug
80113. @Ragnoroct <https://github.com/Ragnoroct>, is it still possible
for this to be addressed before PHP 8.0 is released?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5051 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESESBNTYEDMUDDLSQNXSW3SK4TN3ANCNFSM4KCO5XYQ>
.
|
I have never seen |
There is already a check if The thing that I don't really like is that this got in without any test. It should be doable to write a test for this in FPM as we have got user.ini tests already. Especially if there is more logic coming, the test is really required IMO. |
I have reverted this change in c97da0f. We can reland once there is a solution that satisfies all scenarios. But for now, let's get back to the status quo of previous versions. |
This allows people to use the
CONTEXT_DOCUMENT_ROOT
variable to scan recursively for .user.ini files.There is a bug report open here https://bugs.php.net/bug.php?id=64865 and plenty of other references to this issue on stackoverflow and other forums.
I'm not sure if this should be an RFC or not. So I just created a pull request to start the process.