Moodle backups are now fixed PDF Print E-mail
Friday, 09 December 2005
Weekly backups (and all others) on our local Moodle server have been broken for a couple of months. I found the problem and fixed it today.

Our hosting server enforces certain restrictions on some PHP operations in order to keep the server secure. One thing they do is restrict use of the chmod() function. Moodle uses chmod() internally in a couple of places, particularly when uploading files and making backups, and those functions wouldn't work when we first installed moodle as a result.

A long time back, I fixed this problem by editing the chmod() references (they only appeared in two files) and replacing them with calls to a stubbed out replacement function that did nothing. This worked fine. However, one of those two files requires the other, so the duplicate definitions of the replacement function were causing PHP errors that kept backups from running appropriately. I fixed this problem so the definition of the replacement function would appear in only one place, and now backups are working again.