Activating Slasharguments to get back missing page formatting or design

Activating Slasharguments to get back missing page formatting or design

Florian Kurrle -
Erantzun kopurua: 8

Hi all,

Moodle-Version: 3.3.1+ (Build: 20170714)
Ubuntu: 14.04.1
PHP: 7.1 (oder evtl. 7.0)
MySQL: 5.5.55-0ubuntu0.14.04.1 - (Ubuntu)

Webserver: Apache/2.4.7 (Ubuntu) mod_fcgid Way of installation:/2.3.9 : Git+Shell

On my page I am missing all design and page formatting: http://schulungsmoodle.de/

Possible slasharguments is the reason. How can I check if it is successfull activated or not? Is there a php-option where I can get the info?

I am getting in debug mode this information:

---

GET
http://schulungsmoodle.de/theme/image.php/boost/core/1500568662/u/f2 [HTTP/1.1 404 Not Found 17ms]
GET
http://schulungsmoodle.de/lib/javascript.php/1500568662/lib/javascript-static.js [HTTP/1.1 404 Not Found 14ms]
GET
http://schulungsmoodle.de/theme/image.php/boost/core/1500568662/u/f2 [HTTP/1.1 404 Not Found 12ms]
GET
http://schulungsmoodle.de/lib/javascript.php/1500568662/lib/requirejs/require.js [HTTP/1.1 404 Not Found 14ms]
TypeError: require is not a function[Weitere Informationen]  settings.php:516:1
TypeError: M.util is undefined[Weitere Informationen]  settings.php:614:1
moodle-core-event: Global event published: FORM_ERROR  yui_combo.php:5828:21
moodle-core-event: Global event published: BLOCK_CONTENT_UPDATED  yui_combo.php:5828:21


Puntuazioen batez bestekoa: -
Florian Kurrle(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Howard Miller -
Core developers-ren irudia Documentation writers-ren irudia Particularly helpful Moodlers-ren irudia Peer reviewers-ren irudia Plugin developers-ren irudia

Documentation is here... Using_slash_arguments

It's a web server thing rather than a PHP issue. There is an option in Moodle to override this but you are strongly encouraged to fix it "properly" as there is talk of removing this option.

Howard Miller(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Florian Kurrle -

I know that all but it does not work begi-keinua

Where can I check if I have Slasharguments successfully activated? Is there a message box in moodle or something like that?

Florian Kurrle(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Matteo Scaramuccia -
Core developers-ren irudia Peer reviewers-ren irudia Plugin developers-ren irudia

Hi Florian,
there was in the past a tool for checking the healthiness of a Moodle instance but it has been deprecated due to some false positives.

The easiest way to check for a properly configured support to PATH_INFO - PATH_INFO: this is what's behind Moodle slasharguments - is to look at those URLs that actually reply w/ a 404 like http://schulungsmoodle.de/theme/image.php/boost/core/1500568662/u/f2 where /boost/core/1500568662/u/f2 is the slasharguments value to be found by Moodle via PATH_INFO.
If you disable slasharguments via config.php - not suggested since it will become a requirement - , those URLs will be written as e.g. http://schulungsmoodle.de/theme/image.php?file=/boost/core/1500568662/u/f2 and everything will work as expected.

To help you we need you to share your relevant config files (please, remove sensitive data from there).

HTH,
Matteo

Matteo Scaramuccia(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Florian Kurrle -
Hi,

thanks. It looks like it is deaktivated because only http://schulungsmoodle.de/theme/image.php?file=/boost/core/1500568662/u/f2 works.
I hope in the zip-archive below are all relevant config files.

Is there an example which .htaccess-file I have to create in the moodledirectory to activate Slasharguments.
Florian Kurrle(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Matteo Scaramuccia -
Core developers-ren irudia Peer reviewers-ren irudia Plugin developers-ren irudia

Hi Florian,
?file= works even when slasharguments proper configuration is available, for backward compatibility, in case someone bookmarked or stored the "old" URLs.

In the mean time, simply add:

$CFG->slasharguments = false;

in your config.php file to override/force the setting: this is a temporary workaround.

That being said, I'm not familiar with your setup - why not using PHP-FPM? Constraints from the panel of your shared env? - but from the net it looks like you're missing:

  • php.ini: cgi.fix_pathinfo = 1
  • fcgid.conf (missing in your archive): FcgidFixPathinfo 1

If the configuration above won't still work the only idea I could share is to define the missing PATH_INFO variable, in the context of Moodle, in the environment e.g.:

SetEnvIf Request_URI "^(.+\.php)(/.+)$" PATH_INFO=$2

like done in nginx (https://docs.moodle.org/33/en/Nginx#PHP-FPM).

To test if it will work in any case, just drop the simple file below (name it e.g. __info__.php) in the home of your Moodle install (the same where config.php has been stored):

<?php phpinfo();

and point your browser to it by adding some slash arguments, e.g.: http://<hostname>/__info__.php/path/to/a/file.jpg, and look at the server variables to discover among them one called PATH_INFO and its expected value, /path/to/a/file.jpg.

HTH,
Matteo

Puntuazioen batez bestekoa:Useful (2)
Matteo Scaramuccia(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Florian Kurrle -
$CFG->slasharguments = false; --> This helps temporarly

But you have given me the solution, too. It was to simple. I had only to change
cgi.fix_pathinfo = 0 into cgi.fix_pathinfo = 1

So I did not need to dofcgid.conf: FcgidFixPathinfo 1

Is there an failure in the text: https://docs.moodle.org/33/en/Apache#Slasharguments
I think the text has to changed from cgi.fix_pathinfo = 0 into cgi.fix_pathinfo = 1
Puntuazioen batez bestekoa:Useful (1)
Florian Kurrle(e)ri erantzunda

Re: Activating Slasharguments to get back missing page formatting or design

Visvanath Ratnaweera -
Particularly helpful Moodlers-ren irudia Translators-ren irudia
Hallo Florian

You said:
> Possible slasharguments is the reason.

"Possible" or _the_ reason? If it is not, administering all the medicine mentioned here, will kill your site!
begi-keinua

Have you activated https://docs.moodle.org/en/Debugging and confirmed the cause?