I have a perl program running on a unix box that opens a socket. My PHP sends a command/args to the socket using fsockopen.
Perl receives the command/args, does what it needs to do and returns a string.
Back at the PHP end I'm using fgets to read the data back.
However, all I get is an error stating that the command took longer than 30 seconds and quits.
Does anyone have any ideas. Below is the bit of PHP that I'm using.
$fs = fsockopen($server, $port, $errno, $errdesc, 10);
if (! $fs) {
die("Could not connect to server/host:\nError: $errno = $errdesc\n");
}
$page = '';
fputs($fs, "getdirlist=$path");
while($line = fgets($fs, 1024)) {
$page .= $line;
}
echo $page;