Error for Cron job: "Error in argument 1, char 3: option not found "

Error for Cron job: "Error in argument 1, char 3: option not found "

by محمد نبيل -
Number of replies: 6
Picture of Plugin developers
I got error
I installed Moodle via cpanel
Make a database , Moodle data folder , install Moodle software....., Exactly as rick show in a video ,
But got this error for Cron job:
"Error in argument 1, char 3: option not found "
Average of ratings: -
In reply to محمد نبيل

Re: Vps vs dedicated server

by Ken Task -
Picture of Particularly helpful Moodlers

Show us the cron job text ... sounds like improper redirect ... that stuff after the cron.php > this stuff here.

Consider doing this:

where ever your logs are kept .. like /var/logs/

touch /var/log/moodle-cron.log

Then the cron job becomes

/usr/bin/php /path/to/moodlecode/admin/cli/cron.php > /var/log/moodle-cron.log

Then run it from command line the same as above.

Check the log file: tail  /var/log/moodle-cron.log

Can watch that log in realtime if you needed to:

tail -f /var/log/moodle-cron.log

Above will scroll @ frequency of the cron job.

'SoS', Ken


In reply to Ken Task

Re: Vps vs dedicated server

by محمد نبيل -
Picture of Plugin developers
thank you
i fix it
the error was thar i call:
usr/local/bin/php -q/home/baseraadmin/public_html/courses/admin/cli/cron.php
or
/opt/cpanel/ea-php73/root/usr/bin/php -q/home/baseraadmin/public_html/courses/admin/cli/cron.php
or ..... i cant remember , i tried many
the correct is :
/usr/local/bin/ea-php73 /home/baseraadmin/public_html/courses/admin/cli/cron.php
in fact i do not know what are these commands
it is just a luck
In reply to محمد نبيل

Re: Error for Cron job: "Error in argument 1, char 3: option not found "

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Mohammad, This is not about "Vps vs dedicated server". You should have started a new thread. I hope the moderator would split this new discussion. Gave it a new subject line already.
In reply to محمد نبيل

Re: Error for Cron job: "Error in argument 1, char 3: option not found "

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You might want to double check against https://docs.moodle.org/39/en/Cron.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Error for Cron job: "Error in argument 1, char 3: option not found "

by محمد نبيل -
Picture of Plugin developers
in the doc
/usr/bin/php /.......
the ccommand that work is :
/usr/local/bin/ea-php73 /.....
---------------------------
the doc is wrong , or there is something i do not know?
In reply to محمد نبيل

Re: Error for Cron job: "Error in argument 1, char 3: option not found "

by Ken Task -
Picture of Particularly helpful Moodlers
Doc isn't wrong ... doesn't take into account Easy Apache .... nor any other multiple PHP version tool that providers might offer their customers. To document all providers and their differences is way beyond the scope of Moodle docs. We all pick our poisons (providers) and have to work on our on antidotes (adjustments from 'stock') in some cases.
But congrats to you ... in figuring it out! smile

'SoS', Ken
Average of ratings: Useful (1)