CHMOD error

CHMOD error

by Cathy McLelland -
Number of replies: 3

Hi all,
I'm trying to restore a course to a Moodle installation (version 1.5.2) but am getting the following message:

Creating temporary structures Deleting old data
Warning: chmod(): Permission denied in D:\Websites...\lib.php on line 131
Warning: chmod(): Permission denied in D:\Websites\...\lib.php on line 150

I found a few posts in the forums that suggested ensuring that permissions are set to 0777 in the lib.php file. I have done this but unfortunately the restore is still not working.

I'd be really grateful if anyone could offer advice or suggestions on what the problem might be.

Thanks in advance,
Kathy


Average of ratings: -
In reply to Cathy McLelland

Re: CHMOD error

by Steve Bilton -
Hi Kathy,

I'm a little confused by your post, do you mean you have changed lines in the lib.php file to set files as 0777 or you have set the files in the directory that are being accessed as 0777?


Also (as i'm not sure what those lines say) find where the information is being written to and set the directory they are contained in to CDMOD -R 0755, this will allow you to write files into that directory i think, if not CDMOD 0777 on the moodledata directory. CDMOD -R will set permissions recursively.

if you do set the files to 0777 on the moodledata then don't forget to change it back again (i use 0755) afterwoods otherwise people may be able to access and change your files contained within the dir.

Best of Luck

Steve
In reply to Steve Bilton

Re: CHMOD error

by Cathy McLelland -

Hi Steve,

Thanks a lot for your response. Apologies for being a bit vague in my last post (I'm a bit of a newcomer to these forums). The error message I'm getting when I try to restore a course from a backup is as follows:

Warning: chmod(): Permission denied in D:\Websites\LocalUser\Test_Admin\backup\lib.php on line 131.
Warning: chmod(): Permission denied in D:\Websites\LocalUser\Test_Admin\backup\lib.php on line 150

I checked the lib.php file and found that it was set to 0777. I'll try your suggestion to set to 0755 and see if it solves the problem.

Thanks again,
Kathy

In reply to Cathy McLelland

Re: CHMOD error

by Steve Bilton -
Hello Katy,

I think the problem your experiencing is not to do with setting the permissions of the lib.php file or inside the lib file on those lines.

(I think) What you need to do is find your moodledata folder (where a temp directory is trying to be create) and set its' permission to 0755 or if that doesn't quite work set the moodledata to 0777. If you do end up having to set the moodledata folder to 0777 change it back after you have done what you needed to do to 0755 or whatever it was set to originally.

You may need to set the permissions recursively too using (from outside the main moodle folder (unless you changed the location of moodledata))
" chmod -R 0755 moodledata "(or name of data file)

I'm pretty sure that will get around your problem.

The moodledata folder is normally kept outside the main moodle dir for security purposes.

Best of luck!

Steve