PHP socket connection API to the daemon