change PHP API to use stream socket.