apache segfault with php script that use fsockopen

stffabi

Verified User
Joined
Oct 14, 2004
Messages
46
Hello

I have a little problem. I'm using httpd 2.0.55 and php 4.4.0 sine I've updated the freebsd from 5.3 to the latest 5.4 all php scripts that use a fsockopen will let the apache child to segfault.

The problem is that the connect function of the socket.h returns the error code EINPROGRESS. Does anybody know what this code means?

The interesting thing is, letting the smae php script run uder suphp will work just fine.

Another server with a fresh install von 5.4 and the same configuration doesn't have this problem.

Does anybody know what could cause this problem? I'll also try to completely recompile the kernel and the world an reinstall it again.

The code of my test script is the following
<?php
$fp = fsockopen("localhost", 80,$errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "Connection: Close\r\n\r\n";

fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>

Thanks for any help

Kind Regards
Fabrizio
 
Back
Top