I tried to start a background process with php, for that, I added a & at bottom on exec function but after a few days it stop working.
Basically
If i have file 1.php with:
<?php var_dump(exec('/home/2.php > /home/2.output 2>&1 &'));
And file 2.php with:
<?php sleep(5); echo "Fill
";
Running file 1.php, it return an empty string not -1 or something else, but using console and calling 1.php it work ok:
php-cgi -eq -f /home/1.php
I'm using ubuntu 9.04 with 2.6.18-164.10.1.el5.028stab067.4
Check /var/log/kern.log
for "audit" level error messages. It's possible that the exec is being prohibited for some reason.
It's also quite possible that the write to /home is being prohibited. Try writing to /tmp instead?
Well, after a nightmare trying to solve the issue, finally i update ubuntu from 9 to 10, this solve the problem, i think some update of linux break php, if it happend me again, probably i'll begin rebooting the vps.