Re: ob_start changed from php4 to php5?
| From: | Marten Lehmann | Date: | Fri, 19 Aug 2005 14:51:12 +0000 |
| Subject: | Re: ob_start changed from php4 to php5? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220955@lists.php.net to get a copy of this message | ||
Hello!
I'm also guessing that it's the LAST line of the file with the "encodeDomain" function in it that you "include" in your test.php I'm also guessing that there's a NEWLINE character after the final ?> in that file on your 5.0.4 box, but that NEWLINE character is *NOT* there on your 4.0 box.No, there are no newlines at the end of any files. The problem was a new behavior of system() in PHP5: "The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module." Obviously system() in PHP5 tries to flush, but because it's wrapped in ob_start() end ob_end_clean(), it's doesn't actually do. Unfortunately an interal flag in PHP is set to "output has been sent" anyway (bug?). I first changed it to passthru() instead of system(), but maybe I should use shell_exec() in the future. Regards Marten