Jump to content

Shell_exec won't work with crontab


tibberous

Recommended Posts

When I type the line, crontab -u nobody /home/express/public_html/control/crontabs/process.cron, into putty, it works.

 

Same line, shell_exec("crontab -u nobody /home/express/public_html/control/crontabs/process.cron");

 

Doesn't work.

 

/etc/crontab and /usr/bin/crontab are both set to 777.

 

I tried changing crontab to /usr/bin/crontab

 

I just don't know what else to do, shell_exec doesn't seem to work anything like real shell commands. I get NO output, it just doesn't work.

 

 

Link to comment
https://forums.phpfreaks.com/topic/101899-shell_exec-wont-work-with-crontab/
Share on other sites

No.

 

I think my problem might because PHP is running it as nobody, and I'm running it as root, but there is no reason why it should matter because I changed the permissions on everything.

 

...

 

If I set UID, it doesn't let me run the script at all.

 

Is there a way to set PHP to run everything as root?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.