Good Afternoon dear Moodlers,
I have a problem with my Moodle environment. This morning moodle was giving an error message stating "Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write."
I thought "no problem" and tried to run the php /moodle/admin/cli/purge_caches.php command as per this post https://moodle.org/mod/forum/discuss.php?d=240739 because it has worked for me in the past. To my surprise, I get an error message stating "Could not open input file: admin/cli/purge_caches" So I went the quick/lazy way and just installed a fresh copy of the code and my moodle started working fine.
However, I tried the php /moodle/admin/cli/purge_caches.php command again because I know I WILL need it in the future, and I get the same error message. And I am very scared because I don't want to be downloading a copy of new code every time I get the Coding error.
So, I have 2 questions:
1. How can I prevent the "Coding error detected..." problem from happening? I thought I was smart and I put this line in my cron to run this command every 2 weeks "0 2 * * 2 sudo -u www-data /usr/bin/php admin/cli/purge_caches.php" however, now I get the "Could not open input file: admin/cli/purge_caches" error which leads to my second question
2. How do I fix it so that I can run the "/usr/bin/php admin/cli/purge_caches" command and so that it clears the caches as it's supposed to?
Kind thanks for your help with this.
David Maldonado