PHP Serial Communication NOT working

The arduino DID stop the autoreset when I use the PHP code. But if the Serial Monitor isn't open the page will keep on loading and hangs at the serial open statement.

if the arduino receives anything a relay acts, nothing happens.