Ways to clear cache and check its status

Re: Ways to clear cache and check its status

by Mark Johnson -
Number of replies: 3
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Any CLI scripts run on the Moodle server run with full admin access. The error states that this is an issue with PHP not having the mysqli extension configured correctly, which means it cannot connect to the database.

Take a look at your php.ini file and make sure it includes a line like extension=php_mysqli.so.

Average of ratings: Useful (2)
In reply to Mark Johnson

Re: Ways to clear cache and check its status

by Porsa Barnam -
Thank you Mark for your description.

I checked php.ini file. It has a line with this code: extension=mysqli. Considering that it is run on Windows OS, is it enough for right configuration?

Thank you again.

In reply to Porsa Barnam

Re: Ways to clear cache and check its status

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I would expect XAMPP to have this set up correctly for you, but you could try setting it to something like C:\xampp\php\ext\php_mysqli.dll (assuming that path is correct, if not have a look around your XAMPP install directory to find it).

You can run php -i and look for mysqli in the result to see if you've set it up correctly.

Average of ratings: Useful (1)
In reply to Mark Johnson

Re: Ways to clear cache and check its status

by Porsa Barnam -
Thank you Mark.

I added  your recommended code to php.ini file.

After resetting Xampp, I ran this command:
php \xampp\htdocs\moodle\admin\cli\purge_caches.php

But similar messages was shown, again.

For your information, the main problem is viewing bellow error message when loading Moodle:
Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.

In fact, I want to clear cache to rectify the above error.

(I have created a discussion subject for this error in: https://moodle.org/mod/forum/discuss.php?d=447350#p1797734)

Thanks and regards.