i havent a clue except maybe this will help?
http://www.php.net/manual/en/functio...peshellcmd.php
what about making it it's own script like:
Code:
#script.php
#!/usr/bin/php
do all that stuff here
then: exec(script.php);
haven't tried it, .. i have executed files, but not with the shell_exec() function.