Ok... i have spent the last 8 hours going nuts trying to get a scheduled task to run on my plesk server!! someone please help me!!! I have run: echo exec("which php"); to get my path to php ... which i am told is /usr/bin/php so i have made my cron task look like this: /usr/bin/php -q /var/www/vhosts/mydomainname.com/httpdocs/folder1/task.php NOT WORKING !!!! why?? I seem to remember going through this same problem before and i think the path to php was something else in plesk. but surely if this is the path given to me by echo exec("which php"); it should be right no?
ok.. i think the path to php must be correct but i am getting this: Could not open input file: /usr/local/psa/home/vhosts/mydomain.com/httpdocs/folder1/script.php and yes i did just put all permission to 777 on that file
it's probably because start directory for the user you're running is not / but /var/www/ or /usr/local/psa/whatever... an easy fix would be just to use curl /usr/bin/curl -s http://site.com/updater.php additionally you could htaccess block, or use $_server remote addr to only allow your own server to run the script