Posts made by Martin Dougiamas

Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I just had an idea that might solve the safe mode problem.

The PHP "safe mode" problem is this:

- Moodle files are owned by the user
- Uploaded files are owned by the web server user
- Safe Mode denies all access to files from scripts that are owned by a different user than the file.

So I just had a flash: what if the file-reading script was automatically CREATED by Moodle during installation (from a template stored in the library) - then this script would be owned by the user, and it shouldn't have any problems reading the files.

The instructions for installing Moodle under safe mode could be:

- use FTP or shell to "chmod 777 files" where files is the script folder
- visit the admin page, which will autodetect safe mode and create the safe-mode script
- chmod the directory again to turn off write permissions again "chmod 755 files" (for security)

When upgrading, the admin script could delete the old script and create a new one there (assuming chmod had been done).

Anyone see any problems with that?

It seems so simple - I'm surprised no-one's come up with it before. If it works I think it will have a lot less to go wrong than the FTP workaround which was the best solution until now.
Average of ratings: -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
surprise Yes, everything transfers! When you upgrade you continue to use the same database, and that database is upgraded to use the new features, so NO DATA IS LOST, and no features are lost.

Making a backup of the database is purely a precaution, just in case you need to go back to the old version for some reason.
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Safe mode is not really supported yet.

http://moodle.org/doc/?frame=install.html&sub=requirements

The problem with safe mode is impossible to resolve without help from your administrator or hacking Moodle to use FTP. Hacks are discussed near the end of this thread:

http://moodle.org/mod/forum/discuss.php?d=974

Unfortunately they didn't make it into 1.0.9 due to lack of time, but hopefully the next release.