Apache gives empty reply
11,600
Solution 1
Finally solved by adding to /etc/apache2/envvars
:
export USE_ZEND_ALLOC=0
Solution 2
Look at the main server error log, it should have some Child Segfault Error (11).
This is probably given by a PHP engine fault, often given by a buggy php module, unicode chars handling, gettext corrupted DB, and so on.
It is very difficult to debug.
You can enable xdebug tracing and look at what line it is segfaulting:
pecl install xdebug
php.ini:
[xdebug]
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.auto_trace=1 ; enable tracing
xdebug.trace_format=0
xdebug.show_mem_delta=1 ; memory difference
xdebug.show_local_vars=1
xdebug.max_nesting_level=100
Related videos on Youtube
Author by
Jorge Bernal
Mobile Engineer @ Automattic, making WordPress for iOS.
Updated on September 17, 2022Comments
-
Jorge Bernal over 1 year
It happens randomly, and only on moodle installations. Apache don't add a line in the logs when this happens, and I don't know where to look.
koke@escher:~/Code/eboxhq/moodle[master]$ curl -I http://training.ebox-technologies.com/login/signup.php?course=WNA001 curl: (52) Empty reply from server koke@escher:~/Code/eboxhq/moodle[master]$ curl -I http://training.ebox-technologies.com/login/signup.php?course=WNA001 HTTP/1.1 200 OK
The apache conf is quite straightforward and works perfectly in the other vhosts
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /srv/apache/training.ebox-technologies.com/htdocs ServerName training.eboxhq.com ErrorLog /var/log/apache2/training.ebox-technologies.com-error.log CustomLog /var/log/apache2/training.ebox-technologies.com-access.log combined <FilesMatch "\.(ico|gif|jpe?g|png|js|css)$"> ExpiresActive On ExpiresDefault "access plus 1 week" Header add Cache-Control public </FilesMatch> </VirtualHost>
Using apache 2.2.9 php 5.2.6 and moodle 1.9.5+ (Build: 20090722)
Any ideas welcome :)
-
Jorge Bernal over 14 yearsFound this on error log: zend_mm_heap corrupted [Fri Sep 18 16:47:08 2009] [notice] child pid 7361 exit signal Segmentation fault (11) [Fri Sep 18 16:47:09 2009] [notice] child pid 7368 exit signal Segmentation fault (11) [Fri Sep 18 16:47:10 2009] [notice] child pid 7375 exit signal Segmentation fault (11) Will try xdebug and see if it helps
-
Jorge Bernal over 14 yearsOnly see the segmentation fault and xdebug is not leaving anything useful in /tmp/xdebug
-
Sandokas over 14 yearsit should print a trace of every php function called. So when the trace stops is when the segfault happened. This should suffice to argue what php function is faulting.
-
sglessard about 4 yearsIf you leave that as is for a couple of weeks it will full your hard drive.
-
Sandokas about 4 yearsIt looks like you forgot them as is for 11 years, not weeks 😬😉
-
Artefacto over 3 yearsVery bad idea. This will cause PHP to leak memory when a request finishes with an error.