2

When I run this code via ssh echo wget http://domain.com/send_me_email.php | at 12:54 it ran correctly and sent me an email at that time. Not if I run a PHP script like this

exec("echo wget http://domain.com/send_me_email.php | at 12:54");
exec("atq",$arr);
print_r($arr);

Result of that code is something like this : job 63 at 2011-11-27 12:54 As you can see the job created successfully but I didn't receive any Email at that time?! I test this line in php exec("wget http://domain.com/send_me_email.php"); and it sent me an email, which means that I have permission to run exec and wget via php. I can't understand what the problem is.

hlovdal
  • 26,565
  • 10
  • 94
  • 165
  • 1
    You're executing this under the Apache user account. (Else you would have told use about a suexec setup). Ask your server admin if that account is allowed to utilize atd. – mario Nov 27 '11 at 10:03
  • 1
    There are a bunch of things that could maybe possibly be going wrong, but troubleshooting this is probably best done by asking your sysadmin. – derobert Nov 27 '11 at 10:20
  • 1
    I don't know exactly what you are doing, but it seems to me as if your whole approach to this is flawed. Please explain exactly what it is you are trying to achieve. – DaveRandom Nov 27 '11 at 10:34

0 Answers0