I recently migrated from Amazon Elastic Beanstalk to my own ubuntu 14.04 lts server. Everything ported smoothly except one page that uses ob_flush
and proceeds to do processing. Here is that block of code:
<?php
//put string of page ----> $string
ob_end_clean();
header("Connection: close");
ignore_user_abort(true); // optional
ob_start();
echo ($string);
$size = ob_get_length();
header("Content-Length: $size");
ob_end_flush(); // Strange behaviour, will not work
flush(); // Unless both are called !
session_write_close(); // Added a line suggested in the comment
// Do processing here
sleep(10);
//do stuff
echo "something";
I'm expecting the contents of $string to print, instead the contents of $string, and then "something" print. In this snippet, "something" would still print. I've disabling mod_pagespeed (which is currently enabled), and made sure gzip, and buffer output were set to off.
Here is my php.ini
file (I have it offsite because it's unabridged and possible not relevant to the question). I also have a suspicion this may have to do with my apache configuration file which you can see Here. Finally, if this has anything to do with my issue, here is a link to my pagespeed configuration. When I call the function the error log shows no errors, additionally I have root access to the server. Thank you for helping me fix this issue!
Jake Sylvestre