can not display the css / images on moodle ... help me

can not display the css / images on moodle ... help me

by Teknisi Stemba -
Number of replies: 10

My Installation

- debian 8 (jessie)

- nginx

- php5

- and Mariadb


help me, please


I am a technician Indonesia and just learn to use nginx and moodle. how to fix display css/images on moodle with nginx? thanks


cant display css/images

Average of ratings: -
In reply to Teknisi Stemba

Re: can not display the css / images on moodle ... help me

by Dave Emsley -
I get the same issue trying to install Moodle 3.2.1.

can anyone shine a light on this? There is also a similar thread elsewhere.


Dave Emsley
In reply to Dave Emsley

Re: can not display the css / images on moodle ... help me

by Luke van Tricht -

I recently came up against this issue when setting up Moodle 3.2.1 for the first time. The issue is the abnormal method by which Moodle is calling some of the php scripts, specifically the image.php script in particular I found had the most issue. To correct the issue, I had to modify my web server configuration to expect PHP files with a forward slash(/) at the end. In our case, I did that by changing the NGinx Location directive from .php$ to .php(/|$)

Average of ratings: Useful (2)
In reply to Luke van Tricht

Re: can not display the css / images on moodle ... help me

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers

Luke,

The issue is the abnormal method by which Moodle is calling some of the php scripts

Can you elaborate? What is the "abnormal method" that Moodle is using?

In reply to Luis de Vasconcelos

Re: can not display the css / images on moodle ... help me

by Luke van Tricht -
The accepted standard method of calling a .php file with parameters is with the query string syntax, e.g. image.php?var1=val1, but for certain URLs in the Moodle framework they use an alternative syntax, which is image.php/val1/val2/val3/, and it's those forward slashes that are causing the issues with the location directive.
In reply to Teknisi Stemba

Re: can not display the css / images on moodle ... help me

by Marcelo Leite -

After hours studying about this case, finally I have a solution and I would like to share with us smile

1. configure PHP as described in this link https://moopi.uk/mod/page/view.php?id=78

(this configuration fully supports 'slash arguments' )

2.In the first screen, don't forget to put a slash at the end of moodledata config directory

restart nginx and woilá...images works as expected smile

Average of ratings: Useful (2)
In reply to Marcelo Leite

Re: can not display the css / images on moodle ... help me

by David R. -

Thank you Marcelo for sharing the solution with us. I have been trying to solve it for long hours but still unsuccessful.

I do not think that my hosting provider will allow me to change the nginx configuration in the way that you described. Not sure if they are using nginx at all.

Do you know any alternate way to reach to the same solution?


In reply to David R.

Re: can not display the css / images on moodle ... help me

by David R. -

Finally I could solve it by changing the PHP version in my hosting provider's control panel. Using PHP 7.1.x everything works fine.

In reply to David R.

Re: can not display the css / images on moodle ... help me

by Andres Skliarevsky -

Thank you! I'm on PHP 7.0 where I host. Has anybody tried PHP 7.2? Is Moodle working fine in such php version? TIA.

In reply to Teknisi Stemba

Re: can not display the css / images on moodle ... help me

by Ambikesh Pandey -

Hi Teknisia,


I also faced 3 days back the exactly similar issue which caused me almost 3 days banging my head how to solve it. At last I did it and now I want other to know hoe to do it. Its little tricky and not a profession way to do it. Please fill the form in the screenshot by inspect element and submit it. The next screen which you will see will have a search option where you need to search for slash argument or slash. Other than search nothing will work , no links, no jquery effects nothing as 2 main jqueries were not included properly. So the page which you will see after searching, there will be a default check box which is checked by default. Please uncheck it save it. Congratulations as you just solved your biggest hurdle hear smile . It really worked for me and m sure will work for others unless you haven't changed you location settings through Nginx.


Thanks & regards.

Average of ratings: Useful (1)