> $file=fopen("/tmp/dhcp.log","w+");
Try changing "w+" to "a".
Mode "w+" means that the filepointer is set to the BEGINNING of the file
so every separate flow coming from stdin is overwriting the file again
and again. Mode "a" is append mode (filepointer at the end, appending to
the file).
Tamas