Error: could not find or create a directory

Error: could not find or create a directory

by Richard Lemmer -
Number of replies: 4
I set up an assignment for the first time and when my students attempted to upload their Word files they got a message similar to the one below. This one is different as I added a dirctory called moddata since on the students' messages that was the last directory named.

Any suggestions on hoe to solve this problem woudl be greatly appreaciated.

Warning: mkdir(/home/eflwesl/public_html/chutan/uploaddata/4/moddata/assignment/3/65): Permission denied in /home/eflwesl/public_html/chutan/lib/moodlelib.php on line 1431

ERROR: Could not find or create a directory (/home/eflwesl/public_html/chutan/uploaddata/4/moddata)

Sorry, an error in the system prevents you from uploading files: contact your teacher or system administrator
Average of ratings: -
In reply to Richard Lemmer

Re: Error: could not find or create a directory

by Gaetano Bartolone -

Hi

Either that folder does not exist (very unlikely unless the code has got a prob) or you need to check your folder permissions on your box with command ls -l, this will show you the permissions to that directory......

Within telnet or ftp you can use chmod and chown to fix your permissions so that your php script can right to that folder or subfolder's from your $CFG->dataroot directory

owner and group should be nobody

permissions 755

This owner and group is the default for web servers, but this can depend on your settings and user's on the machine.

Still this does not want to work then set your permission to your $CFG->dataroot directory  to 777, this is more of a risk but it will insure that it works ( I recommend you find a safer setting  after you've got it to work).

In reply to Gaetano Bartolone

Re: Error: could not find or create a directory

by Richard Lemmer -
Thanks Gaetano. It seems that most problems I've encountered with Moodle have to do with permissions. Unfortunately I've had to go ahead and set the permissions for the folder for 777. It should not be a problem since the deadline for submitting is within 24 hours. I can then change then back to the default of 755.

This has reduced my stress levels today. Thanks for the sound advice.

Richard
In reply to Richard Lemmer

Re: Error: could not find or create a directory

by Darren Smith -

I know what you mean but perhaps it is the owner of the folder / moodle files which needs changing?

Thats solved stuff for us in the pass

Darren

In reply to Darren Smith

Re: Error: could not find or create a directory

by Thomas Bekkers -

Dear Darren,

We have exactly the same problem. We are actually replacing the owner of each directory created by moodle using apache with adminxx which is the website owner. This works for each directory modified. But this is not a good solution. How enshuring tat each new directory newly created by apache could work without changing the owner ?

Regards,
Thomas.