In few windows machines, the environment variables "ProgramFiles" is required to successfully execute PHP code especially socket functions.