Enrol by user profile fields scheduled task not running

Re: Enrol by user profile fields scheduled task not running

von Leon Stringer -
Anzahl Antworten: 0
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers

You need to use cd to change into the Moodle source code folder first. You'll need to work out the name of this folder – it contains the Moodle source code for your site – it's probably called something like public_html or moodle. For example, if it's the former the commands would be:

cd public_html
sudo -u "USERNAME" php admin/tool/task/cli/schedule_task.php --execute='\enrol_attributes\task\processenrolments_task'

The output:

Status: 404 Not Found
Content-type: text/html; charset=UTF-8

suggests that the build of PHP on your server is always expecting to send output to the browser, not to the command line. I've seen this before but I don't know why it happens. But hopefully it won't affect running the above command.

Remember, you will need to have debugging enabled for this test – and delete the lock file – to run the processenrolments_task and see if it reports errors. However, if you're running Moodle 3.5 on PHP 7.4 then expect to lots of other errors (such as PHP Deprecated warnings) because Moodle 3.5 doesn't support PHP 7.4.