PHP sample for connect to an agent