Give write access to server to install plugin

Give write access to server to install plugin

by Carrol Moller -
Number of replies: 6

I'm using Moodle 3.6.4+ (Build:20190628)

I installed it on Linux Cloud server.

I installed it in the root.

I want to install the Pattermatch plugin but get the following message:

There is a request to install plugin Pattern match (qtype_pmatch) version 2019091000 from the Moodle plugins directory on this site. However, the location /var/www/html/moodle/question/type is not writable. You need to give write access for the web server user to the location, then press the continue button to repeat the check.

I've read many comments but I still don't know precisely what to give permission and what not.

I checked my config.php file and the permission is set to 0777

Please can anybody help me?

Carrol

Average of ratings: -
In reply to Carrol Moller

Re: Give write access to server to install plugin

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If this is a live site (real users etc.), I would strongly recommend that you don't do this. In fact, if this is a live site I wouldn't add plugins at all without first trying them out on a 'test' version of my site. You would be better installing the plugin 'manually' by unzipping it in the appropriate directory - in this case question/type.

If it *is* your test site then you can set permissions for *all* the Moodle files to 0755 and your own ownership. If you're doing this from the command line, it will be something like

chown -R carrol:carrol /var/www/html/moodle
chmod -R 0755 /var/www/html/moodle

The actual values depending on your setup. If using (something like) cPanel then you'll need to use the file manager but remember to select the option to change the selected directory and all sub directories.

I've said it before and I'll probably say it again. An hour or so reading about Unix file ownership and permissions is time you'll get back many times over.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Give write access to server to install plugin

by Carrol Moller -
Hi Howard
I tried to unzip it from Moodle server but that did not work either. I am self taught and have read a lot but obviously not enough.
If I unzip it on the server: I must probably create the folder to which I want to unzip it and then find the unzip commands for linux or unix?

Since I am using the site with users and everything, I don't want to disrupt the function.
I want to download Pattern match and the Reading plugins that apparently monitor the progress of a person's reading.
Carrol
In reply to Carrol Moller

Re: Give write access to server to install plugin

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You don't need to create the folder. When you unzip the downloaded file it creates a folder. I just downloaded the file and it's currently called qtype_pmatch_moodle37_2019091000.zip

So, if you go to the question/type directory in your Moodle installation and type...

unzip /path/to/wherever/you/downloaded/qtype_pmatch_moodle37_2019091000.zip

That's all you need to do. BUT... it depends on you having permissions correctly set. As I mentioned, I'm doing you a big favour by suggesting you go and find out about Unix permissions rather than holding your hand. It's, honestly, not very complicated.
In reply to Howard Miller

Re: Give write access to server to install plugin

by Carrol Moller -
Thank you, I appreciate it. Every time I learn something else. I do want to empower myself to do it all without consulting specialists. It is just when I am in doubt.
In reply to Carrol Moller

Re: Give write access to server to install plugin

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

'without consulting specialists'

But a well asked question like yours can frequently help out a large number of other people who are reluctant to ask questions smile

Check this out

https://moodle.org/mod/forum/discuss.php?d=391694

Would you post your impressions of pmatch in the quiz forum?


In reply to Carrol Moller

Re: Give write access to server to install plugin

by James Steerpike -
Do you have command line access?
When on your live site and getting this message:
sudo chmod 777 var/www/html/moodle/question/type
Immediately go back to Moodle and click continue and install your plugin.
Then:
sudo chmod 755 var/www/html/moodle/question/type
That changes only the subfolder that needs writing and sets it back to where it should be afterwards ASAP. You should be able to do that from cpanel as well.

(Sudo- this is a command to let ordinary users run commands as root. Will not be necessary if you are logged in as root but creating a sudo user is a good idea)
Average of ratings: Useful (2)