Reputation: 6601
I have the below code to loop through and run an external file. I can't find much info on how to do this properly and its not working.
while($row = mssql_fetch_array($run)){
$arg = escapeshellarg($row['shopkeeper']);
exec("php /var/www/clients/client1/web/products/shopmania/index_test.php \"$arg\"> /dev/null 2>&1 &");
}
How can I debug this? Perhaps its finding the file but the $arg isn't being passed properly, but I have no idea how to test and find out.
THanks in advance.
Upvotes: 0
Views: 178
Reputation: 1035
You just shoud do it like that and have a look a the output.
exec("php /var/www/clients/client1/web/products/shopmania/index_test.php \"$arg\"", $output);
print_r($output);
Upvotes: 2