Hi, I have a problem with the scheduled tasks. I am not the one who hosts the Moodle, I am just an administrator. I changed "Path to CLI" to "/usr/bin/php", but when I clicked on "Run now" an error message popped up (!!! error/generalexceptionmessage !!!). Then I tried to use "C:\php\php.exe" but this time not even "run now" option was there. Can I change path to CLi as an administrator or do I ask the one who hosts?
Suggest you find out what operating system you are running:
Site Admin Menu -> Server -> PHPinfo
First line in the resulting screen says System:
The paths you see in the system paths setting screen are 'suggestions' ... for some. Do you see any other paths set on that screen ... like for GhostScript? If they all show /usr/bin/something ... it's a linux server - linux servers don't know about C:\ ... that's a Windows thing.
So set it back to /usr/bin/php ... then go to scheduled task again. Links to 'run now' there?
The error you saw might be about just the scheduled task you choose. Have you tried other 'run now' links to see if they produce the same error?
First line of phpinfo should be system.
Yes, by what you have shred back ... /etc/php/7.4' does look like a linux.
If you set back to 'usr/bin/php' ... you missed the begining '/'. Should look like '/usr/bin/php'
So every task using 'run now' rendering same error.
There is another setting that must be on (checked):
in Site Admin Menu -> Security -> Site Security Settings
Allow 'Run now' for scheduled tasks box has to be checked ... ie, on.
Then TIA (try it again).
If that does not work, turn on debugging to see what else Moodle might tell ya!
Is there a 'check' next to the box for path to php-cli? See screenshot attached.
If not, wrong path to php-cli? You've not shared what operating system you have ... Linux we know, but there are distributions of linuxes - again phpinfo page at the top will tell you and you could share back here that info.
Go to Notifications ... is it complaining cron job hasn't run there?
The cron job is actually set outside of moodle config ... at the operating system (which you still haven't shared back) level. If you know who admins the backend contact them and ask if he/she could send you a screen shot of the cron job for the moodle. That will show the path to php-cli.
Good hosting providers normally have FAQ's and how-2's for customers. If you know where the moodle is hosted, check those for how to setup cron jobs. That should give you more info about the path to php-cli. Google for that info.
Thank you, I will contact the provider. So maybe the host didn't configure cron properly and that's the trouble?
2 with one response ... maybe ... 'can a plugin break scheduled task' ... possible, but not really 'break' in the sense of throw errors.
Disabling all additional plugins and still having an issue with scheduled task isn't an indication of 'plugin issues' cause in reality, moodle consist of nothing but plugins ... called core. A theme is a plugin (core) + one could install additonal themes (addons/additional).
So the issue is still present? ... cannot use 'run now' link on all scheduled task?
Your screen shots showed cron job had never run. Did you get that setup/resolved?
Reason: the cron job for site includes those scheduled task that are active. Not only that, but in higher versions of Moodle there is a thing called 'ad_hoc_task' ... which is a que of scheduled task that did not complete for some reason ... they run later again to try and finish/complete whatever they do.
So if the main cron job has been off/not configured, your moodle is building up a lot to catch up on. Takes longer to processs whatever and, of course, also uses up resources trying to complete them all.
Go to Site Admin Notifications .... is it still complaining about running of cron?
Your screen shots show cron has never been run. Has that been resolved?
Know this isn't answering latest question, but related ... did you get the php path issue resolved?