php exec() doesn't work
Posted: Thu Sep 23, 2010 9:27 am
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.
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.
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?
Code: Select all
$cronresult = exec("TERM=xterm /var/www/vhosts/xxx/httpdocs/system/application/views/newjob");Code: Select all
$cronresult = exec("TERM=xterm /var/www/vhosts/xxx/httpdocs/system/application/views/temp.sh");#!/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?