PHP gets stuck trying to connect to Arduino

I recommend using double quotes on the mode. Insure that is the correct filename for that device on your Mac.

$handle = fopen("/dev/tty.usbmodem1421", "r+");