Plugin Installation Issues

Plugin Installation Issues

by Jens Gilges -
Number of replies: 4

Hello Community,

I just finished installing Moodle on an Ubuntu Server with the documentation provided here:

https://docs.moodle.org/38/en/Step-by-step_Installation_Guide_for_Ubuntu

After I finished the install I have tried to install the plugin for office 365 Integration which failed right after the zip upload with the following mesage:

Install plugin from ZIP file

Validating local_o365 ... Error
  [Error] Write access check [/var/www/html/moodle/local] 
Installation aborted due to validation failure
I Know that this is based on a permission issues but I followed exactly the guide, so can anybody please help me out with the correct permissions I have to set in order to be able to install plugins.




Average of ratings: -
In reply to Jens Gilges

Re: Plugin Installation Issues

by Ken Task -
Picture of Particularly helpful Moodlers

cd /var/www/html/moodle/

chmod ug+rw local -R

Then try your install again.

Since you are running ubuntu, might have to use 'sudo' in front of command above.   Password you will provide is the same one you used to log into the ssh shell of server.

'SoS', Ken

In reply to Ken Task

Re: Plugin Installation Issues

by Jens Gilges -
Hi Ken,

ran the following command:

sudo chmod ug+rw local -R

I still got the same error

Install plugin from ZIP file
Validating local_o365 ... Error
[Error] Write access check [/var/www/html/moodle/local]
Installation aborted due to validation failure

There are the permissions on the directory local

drwxrwxr-x  2 root root   4096 Jun  7 20:24 local

In reply to Jens Gilges

Re: Plugin Installation Issues

by Ken Task -
Picture of Particularly helpful Moodlers

See the 'root root' on directory 'local' owneships? 

That means user (the first 'root') and group (the second 'root') are the only user/group to be able to write to local.  The GUI web interface to moodle runs under a user/group for apache/web service.

ubuntu typically uses 'www-data' user/group for anything web.

So:

chown www-data:www-data local -R

then

ls -l local

TIA ... try it again.   If it fails again for same reason then your set up may not be using www-data user or group.

You might check config.php for path to moodledata and check ownerships/permissions of your moodledata directory + contents.

'SoS', Ken

In reply to Jens Gilges

Re: Plugin Installation Issues

by Rubens Ramos -

Hi Jens,

I had this very annoying same problem on a CentOS 7, PHP 7.3, Moodle 3.9.1.

I´ve tried change permissions with chmod, etc, etc,  without success.

After a lot of web digging I´ve found a solution. In my case it was a SELinux config issue.

You can see the SELinux status with

# sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

Look for the "Current mode:" line.

I set then a temporary change in SELinux permissions mode to <permissive> with 

# setenforce 0 (setenforce permissive)

This changes the mode from <enforcing> to <permissive>

# sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

After installing the plugins I wanted, I changed back to <enforcing> mode with

setenforce 1

Wish you luck.

Rubens

Note: you must have root access to moodle server