On a server running
Apache 2.2.22 from ports,
PHP version 5.4.6 from ports, output is being garbled on the second load of a script. The problematic behavior was only detected today, but we suspect it began with a recent ports update.
Here is an example script:
<?php // index.php print 'top of index.php<br>'; require 'blah.php'; print '<br>after require'; ?> <?php // blah.php print 'blah'; ?>
The first time after the file is modified, this is the output:
top of index.php<br> blah <br>after require
The second (and any subsequent call) to that same script gives random garbage output like this
ðš~~~`... basically, scrambled junk. Sometimes it is chunks of the filename.
In the Apache error logs, we're seeing segfaults and PHP errors that function "\x0" is not defined, pointing at line 1 in
index.php above. Obviously,
If one saves the file (causes the ctime to change), the next load will again display the expected output, but again any subsequent loads are garbled. Restarting the server accomplishes this, except sometimes you can get 3-4 loads before the scrambling occurs.
I suspect there is an issue with gzip or zlib some other compression or opcode cache or the like. However, our php.ini is exactly the same as another server with the same setup and versions that works perfectly fine.
If someone could point me at a possible cause, or an effective way to further diagnose the issue, I'd appreciate it. I've checked the php.ini settings, set up a minimum sample, and verified that zlib is OFF -- no dice.