If you get control of the CPU again somehow, look in the Apache log to find out what the last-accessed script was.
It is important, though, to understand what you mean by "hanging". On my systems, each PHP script has a maximum time that it is permitted to run before the Apache web server kills it. In such a case, the browser that referred to the script will get no response, so it will appear that the server has hung, but in fact, the server is doing just fine.
To get more information on this, see if you can have a shell session to the server in parallel with the web browser. When the browser hangs, type a command to the shell session (top is a good choice); if the server is still alive, you will get a response to your command. Immediately visit the apache access log, and look at the recent entries there. You might also look at the error log, to see if there are any complaints about scripts taking too long. A good text editor running under your shell would be a great assist.