daniol
(daniol)
April 18, 2011, 9:41pm
1
I receive the following error after upgrading Piwik to 1.3 version on my apache error.log:
(...)
zend_mm_heap corrupted
[Mon Apr 18 23:38:02 2011] [error] child died with signal 11
And… blank page on browser
Plase, help!
phpinfo(): http://78.129.251.106/phpinfo.php
cache cleaned, server rebooted, etc. and no luck
Should I roll back to 1.2.1? How?
matthieu
(Matthieu Aubry)
April 18, 2011, 10:00pm
2
please update your PHP, disable APC, this is not a piwik bug
daniol
(daniol)
April 18, 2011, 10:16pm
3
I think I do not have APC, I don’t see at phpinfo. ¿?
If it’s not a Piwik bug, only affects piwik…
I think I have latest version:
root@vps-283:/# apt-get upgrade php php-*
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
vipsoft
(vipsoft)
April 18, 2011, 10:38pm
4
Can you try again without your auto_append_file and auto_prepend_file scripts?
daniol
(daniol)
April 18, 2011, 11:02pm
5
Solved by removing that (in fact, I moved piwik to a subdomain) :S
That files only gzipped the html response, why the zend_mm_heap corrupted?
vipsoft
(vipsoft)
April 18, 2011, 11:09pm
6
Looks like you found a PHP bug. Unfortunately, it’s hard to diagnose when using mod_php. And the PHP devs tend to mark these types of crashes as bogus when Suhosin is involved and bug fixes are backported to an older php version.
matthieu
(Matthieu Aubry)
April 18, 2011, 11:53pm
7
Anthon would it be possible to detect this setting and throw a warning during install?
vipsoft
(vipsoft)
April 19, 2011, 1:33am
8
If it crashes php, the detection will never be displayed to the user.
We already have checks in servestaticfile to disable compression if either of the above settings are non-empty.
I am curious to see the code for those scripts though.
daniol
(daniol)
April 19, 2011, 8:28am
9
This is the code:
It executes in .php, .css and .js, for gzip, and caching and minifing css and js
Gzip_start:
<?
$charset="; charset=utf-8";
$pathinfo = pathinfo($_SERVER['PHP_SELF']);
$extension = $pathinfo["extension"];
$cache=false;
//ini_set('zlib.output_compression_level', 8);
ob_start("ob_gzhandler");
if($extension=="css") { header("Content-type: text/css$charset"); $cache=true; }
else if($extension=="js") { header("Content-type: text/javascript$charset"); $cache=true; }
else header("Content-type: text/html$charset");
if($cache) {
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])>=@filemtime($_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) {
Header("HTTP/1.1 304 Not Modified");
exit;
}
$minify=(strpos($pathinfo["basename"],'.min.')===false);
header("Cache-Control: must-revalidate");
$offset=6*60*60; //6-1 hour
$ExpStr="Expires: ".gmdate("D, d M Y H:i:s",time()+$offset)." GMT";
header($ExpStr);
ob_start();
include($_SERVER['DOCUMENT_ROOT']."/libs/".$extension."min.php");
}
?>
Gzip_end:
<?php
if($cache && $minify) {
if($extension=="js") {
$javascriptCode=ob_get_contents();
ob_end_clean();
echo JSMin::minify($javascriptCode);
}
else if($extension=="css") {
$cssCode=ob_get_contents();
ob_end_clean();
echo cssmin::minify($cssCode);
}
}
else ob_end_flush();
?>
vipsoft
(vipsoft)
April 19, 2011, 1:08pm
10
I’m guessing the blank page is because it doesn’t set the Content-Encoding header but always calls:
ob_start("ob_gzhandler");
Also, since the PHP default is text/html, and the script being wrapped may set its own content type, I would probably omit this line:
else header("Content-type: text/html$charset");
nrahlstr
(Nathan)
April 19, 2011, 6:48pm
11
I had to comment out the eaccelerator.so in my php.ini to get it working. Solaris 10 php-5.3.2
% /opt/pkg/bin/php -v
PHP 5.3.2 (cli) (built: Jun 29 2010 16:09:59)
Copyright © 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2010 Zend Technologies
% /opt/pkg/sbin/apachectl -v
Server version: Apache/2.2.15 (Unix)
Server built: Jun 21 2010 16:56:21
php.ini changes:
;extension=eaccelerator.so