I'm trying to make an online judge written PHP. My code currently looks like:
exec("gcc /var/www/qwerty.c -o /var/www/binary",$output,$returnval);
print_r($output);
exec("cat /var/www/qwe.txt | /var/www/binary",$output,$returnval);
print_r($output);
However, I want each process spawned by exec
to have at most 1 second to run. I'm not sure how to do this.
set_time_limit() isn't working