deleting a course and fixing an error

deleting a course and fixing an error

by Gaby Díaz -
Number of replies: 2

Hello everybody:

I need help! I created a course but something went wrong and I want to delete it. Antoher thing is that I get this error in the middle of the screen in the web course main page:

Warning: is_dir(): Stat failed for /var/www/html/moodle/moodledata/2/backupdata (errno=13 - Permission denied) in /var/www/html/moodle/course/lib.php on line 821

When I tried to upload a foto to my profile, I get this error:

Warning: mkdir(/var/www/html/moodle/moodledata/users): Permission denied in /var/www/html/moodle/user/lib.php on line 65

When I tried to get to 'Site Files', I get this error:

Warning: mkdir(/var/www/html/moodle/moodledata/1): Permission denied in /var/www/html/moodle/lib/moodlelib.php on line 1013

ERROR: Could not find or create a directory (/var/www/html/moodle/moodledata/1)


The site administrator needs to fix the file permissions

What is happening with the moodledata? I cannot open that page in the server. It doesn't allow me to do it to see what's going on.

Can anyone help me?

Thanks in advance, and remember to explain it very easy for me.

Gabriela

Average of ratings: -
In reply to Gaby Díaz

Re: deleting a course and fixing an error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi,

I assume that you are running this on Linux of some sort! Firstly I am worried that you have your moodledata directory beneath your web directory. This means that you can directly access this data by doing...

http://your.domain/moodle/moodledata

which is poor security at best.

Your main problem though is that the web server cannot read and/or write to the moodledata directory because of the permission settings on that directory. How to fix this depends on a lot of things; what Linux distro you are using, are you using a hosting company (ie, how much access do you have), what access do you have to change this setting.

Basically you have two options: (1) You can change the ownership of this directory tree to be owned by the Apache process, or (2) Make the directory tree writeable by everyone. (1) is the best, but you may not be able to do that if you are using a hosting company.

If you have command line access it would be something like...

chown -R apache:apache /var/www/html/moodle/moodledata
(for RedHat, Mandrake et al)

chown -R nobody:nogroup /var/www/html/moodle/moodledata
(for SuSE etc).
..but you really need to know the user:group for your system.

I STRONGLY advise you to move the moodledata directory out of the www tree though. Something like

mv /var/www/html/moodle/moodledata /var/moodledata

...changing the location to /var/moodledata in config.php

This isn't exactly an easy answer, but I hope it helps!!
In reply to Howard Miller

Re: deleting a course and fixing an error

by Gaby Díaz -

Thanks Howard Miller:

Your answer is really illustrating. I wrote to the webhosting service quoting my question and your reply, to see if they can help to fix this for me. I tried few things before that (really tried to follow your instructions) and didn't go anywhere.

I hope that I can have that fixed soon, so I ca deliver courses shortly!

Thanks for all,

Gabriela