I have a custom C extension loaded in my PHP and inside the extension there's a function does something like this
void a() {
printf("abc");
}
I can call a()
with no problem in CLI mode (command-line) and got the output abc
as expected. But when i tried again in our Yii project in PHP-FPM mode,I couldn't get that output.
What I am sure about is:
- The extension is loaded.
- The function call is successfully made with no error.
- PHP output buffering is turned off. I called
ob_end_clean()
twice before callinga()
, the first call returntrue
and the second returnedfalse
.
So my question is:
Am I supposed to get output from extensions in PHP-FPM mode?
If so, how can I capture the output, or please shoot me some debugging advice.