That depends on how your script is run. If it's a CGI-cript, check the error log of your webserver. If it's a cronjob, you chould get an e-mail notfying you of the error.
Besides, if your script worked before, what has changed? Did you change something in the script, or did you change something on the server itself?