error trying to restore a course

Re: error trying to restore a course

by A K -
Number of replies: 0
I've been hitting the same problem on courses with lots of quiz attempts. A quick search found the following about xmlize.php (I presume this is the same PHP routine used by Moodle?) (The emphasis is mine).

"NEW: This Version works better with PHP 5 -- contributed by Eloy Lafuente

xmlize() is a function written in PHP to traverse an xml file and put it's contents into a PHP array. It works best with small xml files, as big ones (larger than 1 megabyte) will result in a large array, too. There is a function called traverse_xmlize() that helps describe the structure of the array that xmlize() outputs" (from http://www.hansanderson.com/php/xml/)

A number of places on the Moodle site suggest increasing a PHP memory limit. E.g.
"Check your memory limit. It may also be that the "memory_limit" in your php.ini is set too low. Please check your php.ini file and allocate the recommended amount (see Moodle requirements). For Moodle version 1.8 and above at least 40MB is recommended." (from Moodle docs)

Whilst this will circumvent the problem if the file is sufficiently small to process the whole thing 'in-memory', it doesn't provide a backup-file-size independent solution. It would be nice to see one.

Unfortunately, a similar problem has been closed on Moodle Tracker thus:
Resolution: Won't Fix
Priority: Minor Minor
http://tracker.moodle.org/browse/MDL-7551
which is disappointing as the problem causes trouble and consumes time for Moodlers and will continue to do so. The underlying issue, of trying to process a file in memory regardless of the file size, does not seem to have been addressed.