You might need to actually exec a program that launches your compilation in the background.
Shell_exec is actually no help to you because shell_exec waits for the ENTIRE program output, so you're still blocked until compilation finishes.
Take care,
Nik
http://www.bigaction.org/