Your browser is probably what is doing the timing out.

If you know some PHP, then you probably won't find it too hard to pick up another scripting language, like Perl, Python or Ruby. (Since you don't have much to unlearn you could take the opportunity to go farther afield to a language like Lisp or Haskell instead.) If you want to use a web language, even JavaScript would give you the opportunity to get meaningful feedback from your script as it is running.

Alternately you could pick up some advice from

http://www.devshed.com/c/a/PHP/Logging-With-PHP/1/ about how to write a log file, and write a log as PHP is running. That will help you debug your script. For instance log when it finds each prime and you can see how much time you are spending trying to generate primes.

As for your solution, there are many potential improvements that can be made. First your way of generating primes sounds slow. At a guess, you are checking each possible prime by trying to divide by every number less than it. Reading an article like

http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes may give you ideas on how to do that much more quickly. (Having a fairly efficient way to generate a list of primes will help you a lot on many later problems.) Secondly you are generating

**far** more primes than you need. Even an efficient prime sieve will not generate all of the primes up to 600851475143 in any reasonable time, and even if it could, storing over 22 billion primes would take up a lot of memory.

In general a good way to think about the viability your proposed solution is in terms of the number of operations you think you'll need. You have 1 minute. You have a machine that probably executes millions operations per second in a fairly slow interpreted language. So if you can think of an algorithm that probably requires a few hundred million operations, then it may be fast enough. If it probably requires a few billion operations, then you need a better algorithm. As you've just discovered, having one loop in another loop takes the size of the inner loop times the size of the outer loop instructions, which can quickly become a very large number. Doing project Euler problems should help you develop your intuition on this.

A random hint. Can you find an approach that doesn't require you to generate the list of primes at all?