-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix for bug in file handling refactor. #7660
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
While testing the cPanel usage of PHP-FPM, we stumbled on this bug. Without the fix, the zend_string is corrupted and getting odd filenames When using FPM we kept getting "No input file specified". I work for cPanel and we use PHP extensively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. I wonder why that hasn't been reported so far, or has it?
@cmb69 https://bugs.php.net/bug.php?id=81447 looks related. Fix is clearly right, but we should probably have a test for this functionality. |
I am not familiar with your testing suite. Especially a targeted test. In our environment we stand up an fpm pool and submit a request. Without the fix, it fails with "No input file specified", with the fix, the request is properly processed. But that is more of an integration level test, not sure how I would write a targeted/small test. |
Let me investigate how you test things. |
FPM tests are located in https://github.com/php/php-src/tree/master/sapi/fpm/tests, though TBH I don't immediately see how to write the test for this, maybe @bukka can help. |
I am not sure I can test this. I looked at sapi/fpm/tests/tester.inc and "class Tester" is not being tripped up or all those tests would have failed. Sorry I will leave the testing to you. |
Can you provide FPM config and some script that is failing with that. It should be possible to recreate it but need a bit more info... |
I will get you whatever info you need. In our environment, username cptest1, domain cptest1.tld We stand up Apache, but NGINX would work as well. The critical info for the Apache vhost config We proxy pass to the fpm master process.
The config for the fpm pool:
Then to get the error
The contents of index.php are not relevant, and you should add the record to /etc/hosts. If you need more info let me know. Julian |
This was my attempt to create a test, but it didn't work: https://gist.github.com/nikic/401a1b46c944908f47bbd0eb7932f159 Not sure how to make the tester actually make use of the doc root. |
I will try to find some time on this over the weekend and see if I can come with a test. If not, we can merge it without it... |
New PR created with this fix and a test: #7673 . So closing this (the same commit is still used in that PR so credit will be there :) ). @nikic Looking at your test it was almost there. The main missing bit was that the |
While testing the cPanel usage of PHP-FPM, we stumbled on this bug.
Without the fix, the zend_string is corrupted and getting odd filenames
When using FPM we kept getting "No input file specified".
I work for cPanel and we use PHP extensively.