[mpm-itk] ITK seems to make PHP's file_get_contents() hang with https URLs.

David Earl david at frankieandshadow.com
Thu Dec 17 15:10:14 CET 2015

This sounds like the same KeepAlive timeout problem that I found 3 months
ago happening with Apache 2.4 and SSL with certain user-agents (mostly IE
and ios safari). 60 seconds is perfect for the KeepAlive interval.

Steinar did a fix for it (I assume this isn't in the main Jessie release
yet): see this thread:

This was the thread about the problem (you may want to look towards the


On Thu, 17 Dec 2015 at 14:36 Rich <forums at artfulrobot.uk> wrote:

> Hi,
> Long time user of ITK, but have had a few problems since upgrading to
> the version packaged with Debian Jessie (2.4.10).
> The one I'm stuck on took me ages to track it down to ITK, which I
> believe is to blame because if I turn it off the problem goes away.
> When using PHP (5.6)'s file_get_contents() function with an https URL
> that points to the ITK-enabled Apache 2.4 server, it will hang,
> indefinitely or for a socket timeout of 60s.
> Using wireshark and strace I can see that PHP is able to connect and
> receive the data at normal speed, but then just sits waiting. It doesn't
> close the connection for some reason.
> My test environment was:
> 1. Install Debian 8, Apache 2.4, php-cli 5.6
> 2. Install a valid SSL certificate
> 3. make a static file available as index.html (the default will do).
> And the test is running:
> bash$ php -r '$a =
> file_get_contents("https://your-domain-here/index.html"); print
> gettype($a) . "\n";'
> Which should return quickly echoing just "string" (this function returns
> FALSE if it fails to download).
> Then install apache2-mpm-itk package, enable the module (if that's not
> done automatically for you), restart apache, re-run test.
> The command then hangs, possibly returning at 60s, possibly not.
> Is there anything that can be done to fix this in configuration? Is it a
> bug?
> Thanks,
> Rich
> _______________________________________________
> mpm-itk mailing list
> mpm-itk at err.no
> http://lists.err.no/mailman/listinfo/mpm-itk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.err.no/pipermail/mpm-itk/attachments/20151217/b4b46dee/attachment.html>

More information about the mpm-itk mailing list