Use flup or flipflop in fcgi script