Page 1 of 1

php exec() doesn't work

Posted: Thu Sep 23, 2010 9:27 am
by fredass
i want to execute comand crontab [file] from php code, but there no result. The crontab is not changed and no error message is return.

Code: Select all

$cronresult = exec("TERM=xterm /var/www/vhosts/xxx/httpdocs/system/application/views/newjob");
also tried to put that command to script and execute script. The result was the same: crontab is not changed and no error message returnd.

Code: Select all

$cronresult = exec("TERM=xterm /var/www/vhosts/xxx/httpdocs/system/application/views/temp.sh");
The script:
#!/bin/sh
crontab ./var/www/vhosts/xxx/httpdocs/system/application/views/new_cronjob

When I execute that script from terminal it works - crontab is changed.
Also tried to execute simple commands from php such as ls and it worked.

Any ideas?