Installing and upgrading help

Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?

 
Picture of Marina Glancy
Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 
We are preparing the requirements for Moodle 2.9 release - see MDL-48145

There are several reasons to finally require slasharguments and get rid of the setting:

Use slash arguments slasharguments
Default: Yes

Files (images, uploads etc) are provided via a script using 'slash arguments'. This method allows files to be more easily cached in web browsers, proxy servers etc. Unfortunately, some PHP servers don't allow this method, so if you have trouble viewing uploaded files or images (eg user pictures), disable this setting.


First: it will ease some new feature development (such as JS framework). Besides, Moodle already has several areas that do not work correctly with slasharguments disabled.

Second: if Moodle prevents installation on the server that does not support slasharguments, it will force people to read documentation and set up the server properly instead of creating the forum posts AFTER installation asking why does not CSS load for them.


The question is - do you know of any [modern] server which it is not possible to setup to use slasharguments? If we require it, what can we potentially break? Can it prevent you or somebody you know from upgrading?

Should we extend existing documentation in Moodle to cover more cases when slasharguments might not be working by default?
At the moment docs are:
https://docs.moodle.org/28/en/IIS#Slasharguments
https://docs.moodle.org/28/en/Apache#Slasharguments

TIA
 
Average of ratings: Useful (1)
Me!
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 
https://moodle.org/mod/forum/discuss.php?d=83445

Thread about slash args in nginx - summary is it works, but we lack docs on it.
 
Average of ratings: -
Picture of Marina Glancy
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Thanks Damyon, I have created a page about Nginx under "Installation" category in Moodle docs 2.8:

https://docs.moodle.org/28/en/Nginx

Basically, the first paragraph is copy-paste from wikipedia, and the following is copy-paste from the forum post above. I will appreciate very much if Nginx guru make corrections and add more details there.

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Marina and Damyon,
please beware of some of those configurations: they rely on an "internal" URL rewriting to get full advantage of the HTTP GET file param i.e. when Moodle is supposed to work w/o the slash arguments support i.e. we must take care of not changing how get_file_argument() works now (HTTP GET check first): https://github.com/moodle/moodle/blob/f63dec4bb2a6148ae0ea56e98af970aa2ed67505/lib/weblib.php#L1068.

Shortly, we could force slash arguments support while the core code in weblib.php should still allow the "old way" to work since many people rely on that functionality. From a browser perspective it looks like the web server support slash arguments even if internally - i.e. Web server => FPM - they are using the HTTP GET way of providing the relative file path.

HTH,
Matteo

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Here is a nice example of FastCGI configuration with PHP FPM: http://wiki.nginx.org/PHPFcgiExample.
PATH_INFO is explicitly extracted via fastcgi_split_path_info:

        location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
                if (!-f $document_root$fastcgi_script_name) {
                        return 404;
                }
 
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
        }

HTH,
Matteo

 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
My recent encounter, "Connection between "slasharguments" and mini-sites?" https://moodle.org/mod/forum/discuss.php?d=276218, on FreeBSD.
 
Average of ratings: -
Picture of Marina Glancy
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 
Hi Visvanath, so what was the end of your story? Did you find the way to configure server and enable slasharguments? Or did you just disable them?
 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
No real solution as such, only a workaround. See "Re: Connection between "slasharguments" and mini-sites? [CLOSED]" https://moodle.org/mod/forum/discuss.php?d=276218#p1189597.

The workaround for the mini-sites (read the post linked above) was to serve them from a different web server. Well, if you would call a Raspberry Pi a server. The Pi was necessary for the course anyway, so I fetched Apache and copied the (static) site in to it. The only complication is that those web pages are now are visible in the Net, no big deal, all are educational material.
 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Visvanath,
the behavior you described in https://moodle.org/mod/forum/discuss.php?d=276218#p1189452 is the same as described in https://moodle.org/mod/forum/discuss.php?d=277683#p1193775 : pretty sure of that since I've exchanged several PMs with the OP.

For "some reasons" PHP-FPM is not able to provide the PATH_INFO data back to PHP when the "relative path" contains at least a white space: both the system suffer of the same issue, on different OSs and stack but FPM.

This is not a Moodle issue: this is an environment configuration issue or a bug in the PHP-FPM module. You can isolate and replicate it simply dropping a <?php phpinfo() PHP file into the root of where Moodle has been deployed and try to add a PATH_INFO at the end of the URL in the browser.

I'd happy to replicate the issue on my local dev environment to go further with the investigation but due to the lack of time and local resources I haven't tried yet.

HTH,
Matteo

 
Average of ratings: Useful (2)
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
Hi Matteo

Appreciate your continuous support on this issue. Sorry that I can not offer anything constructive. As I wrote in the "CLOSED" post in that thread https://moodle.org/mod/forum/discuss.php?d=276218#p1189597, I do not plan to follow up. a) I don't know PHP framework at this system level b) it is not my machine.

There is obviously "an environment configuration issue or a bug in the PHP-FPM module" which I wanted to point out to the OP. That's all.
 
Average of ratings: -
Sketch...
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
You can isolate and replicate it simply dropping a <?php phpinfo() PHP file into the root of where Moodle has been deployed and try to add a PATH_INFO at the end of the URL in the browser.

Matteo, can you explian that what you mean? How do you "add a PATH_INFO at the end of the URL"?

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Luis,
please, read the post hyper-linked1 to the "<?php phpinfo()" text, for your convenience: https://moodle.org/mod/forum/discuss.php?d=277683#p1193114.

Given the URL of your phpinfo file, http://hostname/path/to/phpinfo.php, here are examples of PATH_INFO data being added to that URL:

  • http://hostname/path/to/phpinfo.php/
  • http://hostname/path/to/phpinfo.php/folder/
  • http://hostname/path/to/phpinfo.php/folder/subfolder/
  • http://hostname/path/to/phpinfo.php/path/to/folder
  • http://hostname/path/to/phpinfo.php/filename with a whitespace
  • http://hostname/path/to/phpinfo.php/filename_UTF8_encoded_それが動作するはず

PATH_INFO is formed by those extra chars appended at the end of the URI identifying a resource served by your web server: audio, video, images can have this data too e.g. useful to provide info read by JS, if required by a particular framework/logics.

IIS supports that info but you need to properly configure IIS to manage even the UTF8 chars like the ones provided by copying and pasting from Word e.g. “ ” – (are those the root reason for your headaches?): https://docs.moodle.org/28/en/Internet_Information_Services#Optional_UTF-8_file_name_fix, including https://docs.moodle.org/28/en/Internet_Information_Services#Slasharguments.

HTH,
Matteo

 

1 If you look at my way of posting I'm used to put several hyperlinks to provide the refs about what I'm arguing in my statements wink.

 
Average of ratings: Useful (1)
Sketch...
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
See my coments in MDL-47645 for the tests I did. It seems that my PATH_INFO is correct (I think!)
 
Average of ratings: -
Picture of Michael Aherne
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

We had problems with slasharguments when trying to set up Varnish as a caching proxy in front of Moodle, and ended up having to switch it back off. I'm afraid I can't remember the details, as it was quite a while ago, and it may just have been lack of knowledge on our part, but it may be worth checking this.

 
Average of ratings: -
Picture of Howard Miller
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Some hosting companies appear not to support it. At least, the answer to broken pictures of "turn off slasharguments" fixes it. 

Sorry I can't be more precise.

 
Average of ratings: Useful (1)
Sketch...
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers

Hi Marina,

Second: if Moodle prevents installation on the server that does not support slasharguments, it will force people to read documentation and set up the server properly instead of creating the forum posts AFTER installation asking why does not CSS load for them.

Can you post the link to that documentation?

The existing documentation on Moodledocs does not describe a setup that absolutely prevents the css problems that are, presumably, somehow related to slasharguments. And I have had a tech support person from Microsoft confirm that our Windows/IIS servers are correctly configured.

I agree that turning off slasharguments is not a "solution", rather it's a "workaround". But being able to toggle slasharguments on and off has been extremely useful in a few busy or emergency situations, so making it a requirement and forcing it to be enabled really worries me until I can work out a solution to the problems described in MDL-47645. Some of the theme rendering problems raised in the forum discussions linked to in MDL-47645 don't all seem to be caused by lazy admins who haven't read the documentation.

So until that is resolved, it would be nice to have the flexibility to still be able to turn slasharguments on and off.

 
Average of ratings: Useful (1)
Picture of Marina Glancy
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Hi Luis, the links were in the original meesage:

https://docs.moodle.org/28/en/IIS#Slasharguments

https://docs.moodle.org/28/en/Apache#Slasharguments

Nginx page did not exist, I just created it last week: https://docs.moodle.org/28/en/Nginx

I've seen a lot of tracker issues and forum posts about IIS, so I was mostly referring to people not reading IIS documentation properly. 

 
Average of ratings: -
Picture of Paul Verrall
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Moodle on NGINX with slashargs works great for me. I have updated the NGINX page for 2.9 with my input.

https://docs.moodle.org/29/en/Nginx

 
Average of ratings: Useful (2)
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
And here is a sample: "Re: 10 Mini-PCs With Pre-Installed Linux" https://moodle.org/mod/forum/discuss.php?d=312419#p1256208.
smile
 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

TNX Paul for having updated the docs: I was pretty sure that something like my post above could work big grin.

Did you have the chance to test all the URL patterns suggested here?

TIA,
Matteo

 
Average of ratings: -
Picture of san san
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

I tested those URLs, all passed except the last one, should i be worried? Also Profile pictures are not working. Can it be related? I'm using mod_fcgid. My post, in case someone has some light about this..

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

 
Average of ratings: -
Picture of Paul Verrall
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Hi Matteo, I'm not 100% sure what the expected result should be from those patterns. Using them verbatim in my test setup returns the homepage with no errors. All images, css and js load correctly and I have not encountered any issues thus far in general usage.

Thanks

Paul

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Paul,
I'm thinking at that specific set of URLs as a candidate master check in Moodle to validate how the PATH_INFO has been configured in the environment hosting the Moodle instance. In that set you'll find even blank spaces and UTF-8 chars to check for the correct URL encoding.

To verify if your system supports all of them just use the PHPinfo page inside Moodle e.g., using the demo site, try http://demo.moodle.net/admin/phpinfo.php/filename_UTF8_encoded_それが動作するはず, logged in as admin and look for the PATH_INFO value in the Apache Environment section: it must match with the expected PATH_INFO value which is in the example: /filename_UTF8_encoded_それが動作するはず.

HTH,
Matteo

 
Average of ratings: Useful (1)
Picture of Paul Verrall
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Thanks Matteo,

My Nginx/PHP-FPM environment returns the correct values under a phpinfo() output, matching the demo sites output for those URLS. In both cases whitespaces are absent, but I assume this is correct as it is the case for demo.moodle.net also.

The only difference is that there is not an Apache environment section (for obvious reasons), instead the values come under the heading of 'PHP Variables' which unfortunately is not included in the Moodle admins output of phpinfo, i.e.  phpinfo(32).

All the config to get this working is now included at in the 2.9 Nginx docs.

Thanks

Paul

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Paul,
that's strange, http://demo.moodle.net/admin/phpinfo.php/filename with a whitespace returns:

QUERY_STRING no value
REQUEST_URI /admin/phpinfo.php/filename%20with%20a%20whitespace
SCRIPT_NAME /admin/phpinfo.php
PATH_INFO /filename with a whitespace


as expexted.
This check is important because here in the Community there were posts reporting issues w/ blank spaces in the filename, depending on the fact that those blank spaces were not there in the PATH_INFO as expected. This missing could affect your instance if someone will upload file w/ spaces in the filename.

Apologies for not telling you about the constant missing in the PHPinfo page: FYI, MDL-50415.

Thanks for improving the docs, including XSendfile which makes the difference when serving the files!

HTH,
Matteo

 
Average of ratings: Useful (1)
Picture of Paul Verrall
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Thanks Matteo,

Turns out this was just user error, all examples and handled correctly smile

 
Average of ratings: -
Picture of Rolf Petersen
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
 

Hi Tia

We are using 2.7 on a win server 2012/2 and we had to switch slashargs to OFF to get german special characters work. We have a lot of user-documents like "...pöhl....doc". So special character "ö" in it. When slashargs are "ON" the links to these docs do not work. We have to work with slashargs "OFF". So I think we will still need the possobility to set it our own.


Thanks 

Rolf

 
Average of ratings: Useful (1)
Sketch...
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers

Rolf,

That seems like a different issue - although also related to slasharguments. I really think it deserves it's own report and investigation. Can you create an issue in the Moodle Tracker and specify all the details about your server setup and a detailed description of this problem and how you experienced it.

Thanks.

 
Average of ratings: -
Picture of Petr Skoda
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersDocumentation writersPlugin developers
Hi Luis,

I guess there is no need to create yet another slashargument issue, the code is fine, what people need is more detailed documentation for different servers. The PHP code cannot do much because it does not control what happens to page parameters before they get to PHP. Even testing the current settings is problematic, standard environment test cannot do it, a new test script would have to use curl to fetch itself.

Anyway I am a bit surprised that the biggest proponents of IIS and Windows on servers in general are not able to configure their own servers. Developers do not use Windows on servers, I am afraid you cannot expect them to write docs for this platform describing all possible problems and solutions.

I am afraid admins that insist on using IIS or Windows need to step up and write docs, test new releases regularly and fix problems when they pop-up.

Good luck, you will need a lot of it!

Petr
 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Rolf,
have you already tried to properly configured IIS to support UTF8 chars via FastCGIUtf8ServerVariables? Refs: https://docs.moodle.org/28/en/Internet_Information_Services#Optional_UTF-8_file_name_fix. An example about the impact of such missing here and below.

HTH,
Matteo

 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
Late comer (as usual) to this. If I understand right, Moodle had the switch Site administration > Server > HTTP > Use slash arguments (slasharguments) = Yes by default. From 2.9 onwards there is no such switch, it is assumed to be Yes.

First question: The switch is still there in 2.9+ Build: 20150521. Has the transition been postponed?

On plain LAMP, say Debian 7 or Ubuntu 14.04 LTS, slasharguments=Yes requires that cgi.fix_pathinfo=1 in php.ini (or through .htaccess).

Question: https://docs.moodle.org/28/en/Apache#Slasharguments says, "To turn it on, add this line to your httpd.conf, or to a .htaccess file in your local directory:
AcceptPathInfo On"

Which one is correct, php.ini or httpd.conf?

Second question: What is a good "php location" for LNMP (nginx)? There have been various suggestions in the documentation and discussions.
- https://moodle.org/mod/forum/discuss.php?d=278916#p1198421
- https://docs.moodle.org/28/en/Nginx#Slasharguments
- https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm#Nginx_1.4.6
- Various ideas in the discuttion "Relative Links/PATH_INFO/slasharguments problem" https://moodle.org/mod/forum/discuss.php?d=83445, spanning 2007-2012.

Can someone suggest a tested version for Linux, say Debian?

No, it is not a follow-up to "Connection between "slasharguments" and mini-sites?" https://moodle.org/mod/forum/discuss.php?d=276218. (That one was on FreeBSD for somebody else, and closed for me.) This is Raspbian on a Raspberry Pi 2, trying to replicate https://moopi.mrverrall.co.uk/.
 
Average of ratings: -
Picture of Howard Miller
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Question 1:
Both are correct. They both need to be on for it to work. Both are the default settings afaik, so this is only an issue where (e.g.) a hosting company has disabled this. They would possibly do this for compatibility with ancient scripts.

 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Core developersParticularly helpful MoodlersPlugin developers

Hi Visvanath,
please follow the future of slasharguments in MDL-50182.

HTH,
Matteo

 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Requiring slasharguments in Moodle 2.9 - will anybody be seriously affected?
Particularly helpful Moodlers
>>> First question: The switch is still there in 2.9+ Build: 20150521. Has the transition been postponed?

Matteo, thanks for https://tracker.moodle.org/browse/MDL-50182. The current stand is either with Moodle 3.0 or even 3.1.

>>> On plain LAMP, say Debian 7 or Ubuntu 14.04 LTS, slasharguments=Yes requires that cgi.fix_pathinfo=1 in php.ini (or through .htaccess).
>>>
>>> Question: https://docs.moodle.org/28/en/Apache#Slasharguments says, "To turn it on, add this line to your httpd.conf, or to a .htaccess file in your local directory:
>>> AcceptPathInfo On"
>>>
>>> Which one is correct, php.ini or httpd.conf?

Howard, thanks for the input. So on LAMP it has to be both: "AcceptPathInfo On" for Apache (httpd.conf or .htacess) and cgi.fix_pathinfo=1 (through php.ini).

>>> Second question: What is a good "php location" for LNMP (nginx)?
>>> [...]
>>> Can someone suggest a tested version for Linux, say Debian?

I'll keep in touch with https://docs.moodle.org/29/en/Nginx and the subthread https://moodle.org/mod/forum/discuss.php?d=278916#p1257517.
 
Average of ratings: -