-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix #66048 (temp. directory is cached during multiple requests) #524
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
Move php_shutdown_temporary_directory() from php_module_shutdown() to php_request_shutdown()
|
if you want this to be merged to the 5.4, please mark the pull request against the php-5.4 branch instead of master. |
|
Thanks, I've removed my wish as I'm not sure how relevant that is for 5.4. There's no sys_temp_dir ini directive so only users using apache putenv are affected. |
|
Not sure about it. I was thinking about reseting the env in the ini set handler for sys_temp_dir, which would then need to be changed (OnUpdateStringUnempty actually) |
|
I'm hit hard by this problem, as we give virtualhosts their own I wonder if caching the function's result is really needed at all. I see the cache was introduced in 2002. The function's contents do not look very expensive, and I would assume that user scripts don't call this function enormous numbers of times... |
|
I have made some improvements about this bug. If OK, I'll then review it again then merge it |
|
Wow, that looks awesome. I will test it tomorrow! |
|
@lifeforms any news? |
|
@kaplanlior Oh, sorry, I commented on the PHP bug itself: https://bugs.php.net/bug.php?id=66048 Copying my comments: The fix resolves the issue completely! First built php7 master from source on Ubuntu 14.04 LTS to reproduce the problem on PHP7: yep! Then built fix-66048: problem resolved! :) I tried to apply the diff to 5.6.8 but wasn't immediately successful as it's quite different (error_clear_last and such), do you think it can be backported? |
|
This cannot be backported as it could break apps in stable branches. |
|
@jpauli In your first comment you claim moving the php_shutdown_temporary_directory function from module to request shutdown handler (you said it the other way round) is the "quick and dirty way" of doing things. So you came up with a solution which is doing exactly the same (plus some renames and moves). Anyway I'm fine with your solution for PHP7 but can someone please merge THIS fix to the PHP 5.6 branch. PHP 5.6 won't be gone anytime soon and the fix is really very simple and straight forward. |
|
Furthermore: We're using this patch since I've created this PR. Customers have thousands of apps running, no breakage. In fact the current behavior breaks apps because wrong sys_temp_dir variables get passed to them. fpm and cgi/fastcgi don't suffer from this bug and no breaking apps in sight. |
|
Yeah, current behavior is very problematic :( What could be wrong with the PR? |
|
This has been merged in 5.5 and up |
Move php_shutdown_temporary_directory() from php_module_shutdown()
to php_request_shutdown()