Permissions Issues

Permissions Issues

by Aretha Etienne -
Number of replies: 4

When trying to access certain pages in Moodle, I'm getting the error:

Invalid permissions detected when trying to create a directory. Turn debugging on for further details.

I get this message under the Site Administration --->Advanced features  


In my config.php file, my $CFG->directorypermissions = 0750;


In the www/var/moodle directory, the directories are:

755  root root

and the files are:

644 root root


In the www/var/moodledata directory, the directories are:

755  www-data www-data

and the files are:

644 www-data www-data


Should the $CFG->directorypermissions be set to 750 as it is in my config.php file?


I get error when I try to install plugins and then I have to go to the moodle directory and change the permissions to 777 in order to install plugins.


Can someone please advise what's wrong?


Moodle is ran on our virtual server.

We are running Moodle 3.01



Average of ratings: -
In reply to Aretha Etienne

Re: Permissions Issues

by Randy Thornton -
Picture of Documentation writers

The issue is that it is the root user who has the permissions to the var/www/moodle directory, but www-data is the web server user.

When you are installing plugins via the Moodle interface in Site admin > Plugins, it is the web server user www-data who is doing the work and so needs the permissions to create the directories and write to things.

In one sense, nothing is wrong. You don't need to give the www-data user write permissions to the moodle directory for normal use, but you do when installing or updating code.

In reply to Randy Thornton

Re: Permissions Issues

by Aretha Etienne -

Thank you.   So when I get the following error on the Site Administration-->Notifications

Fatal error: Cannot redeclare class lesson in /var/www/moodle/mod/lesson/locallib.php on line 0

 

Does this mean there is a permission issue as well?  I have not been able to find anything regarding this error message.  Does line 0 indicate that it has no permission to access this file?  Because this file is not empty.

In reply to Just H

Re: Permissions Issues

by Randy Thornton -
Picture of Documentation writers

I would agree - I've seen several such redeclare error issues lately on more than one site and they were all related to opcache issues not permissions issues.