I want to check of some local servers on my network are on-line and therefore I want to use the ping function.

I have tried several commands like:

$str = exec("ping -w 5", $input, $result);

but when I print $result I only see the first line like:

PING ( 56 data bytes )

but I don't see the result of the ping action.

The script is not waiting for the result of the ping action. When I do the same with f.i. ls command, I see the right reaction.

The linux system running is apache 2.2.14

Can anybody give me a hint what I have to do?

Greetings, Frans