@Leo Thompson - That's correct, but now when you get that error page, you should get more details. So, do you see more info ?
If not, then most likely the web server ends the request before it completes, giving that error, so the fix is to simply incrase the server timeout value... that's something the host should do for you.
@Leo Thompson - The problem is that the error you see is from the web server, basically PHP doesn't even get executed.
I don't have many options for you, but your hosting should be able to look in the logs and say exactly why you get that error.