Nice, riddles again instead of straight answers/questions. The http user (www-data for example) needs permission to write to the temporary directory. If it can't write to /tmp for whatever reason, just change /tmp in the script to a directory that the http user can write to (the script's current directory, or its parent if that's easier/safer). But as long as you don't let your host solve your UDP socket creation problem, the script will be of no use to you.