Moodle 2 upgrade problem - no images/icons loading

Moodle 2 upgrade problem - no images/icons loading

by Matthew Dumont -
Number of replies: 20

After an upgrade to Moodle 2.0 (and subsequent upgrade attempts - just tried updating to the latest code yesterday) images and icons on our Moodle install were not appearing. Our shared host has worked with us to clear all obstacles that they were responsible for (some php changes etc.), but they insist that at this point it must be a problem in the Moodle code or I need to know better what the problem is. I have already found other similar threads and have attempted working through those solutions.

Images and icons are not loading, unless they are hosted externally. Here is a piece of the source code where an image failed to load:

<img src="http://<mydomain>.com/moodle/theme/image.php?theme=standardold&amp;image=f%2Fpdf&amp;rev=148" class="activityicon" alt="URL">

Does it make sense to anyone as to why images aren't loading based on this code? Is there a fix for this?

Changing themes, even to new themes that came in with Moodle 2.0 result in the same problem. Everyone else does seem to work, although I do notice the server is a lot slower (hopefully this will improve when images load?)

Average of ratings: -
In reply to Matthew Dumont

Re: Moodle 2 upgrade problem - no images/icons loading

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is it still at the same URL as it used to be, or did that change as part of the upgrade?
In reply to Howard Miller

Re: Moodle 2 upgrade problem - no images/icons loading

by Matthew Dumont -

Same URL... actually I just installed a fresh install to a subdirectory and am noticing that no icons or images are loading as well even in the brand new install.

How can I nail down what part of the PHP is misconfigured? The installation tests all passed (php version is 5.2.9) but still said that was ok.

In reply to Matthew Dumont

Re: Moodle 2 upgrade problem - no images/icons loading

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
First - turn Debugging up full (and display on) in Site admin > Development > Debugging

Then right click on the little arrow icon where an image should be and display it in its own window. What do you get?
In reply to Howard Miller

Re: Moodle 2 upgrade problem - no images/icons loading

by Matthew Dumont -

Thanks Howard, I have debugging turned on.

There does not appear to be a way to display an image in a new window that has not loaded. In Firefox, if I right click a failed loaded image and click view image, this error comes up:

Forbidden

You don't have permission to access /moodle/theme/image.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache Server at <domain here>.com Port 80

Seems like a permission error of some sort? Anything I can change or direct my host to change? Have had a great run on this host for several years until now.

In reply to Matthew Dumont

Re: Moodle 2 upgrade problem - no images/icons loading

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well, there's lots of reasons. The number one choice would be permissions on those files or directories. They all need to be readable by the web server 'user'.

Failing that, it could be some weird configuration error on the server. The missing error document, doesn't speak well of your host wink

The real answer can usually be found quickly by looking at the web server error log just after generating this error. It should give the actual reason for this complaint.
In reply to Howard Miller

Re: Moodle 2 upgrade problem - no images/icons loading

by Matthew Dumont -

Thanks!! I will keep digging... this gives me some directions to go in. smile

In reply to Matthew Dumont

Re: Moodle 2 upgrade problem - no images/icons loading

by Mary Evans -

Sorry for asking a silly question, but are there any images in the pix directory of all the themes? Indeed are there any images in the moodle/pix directory?

I am assuming the permissions have all been checked and the config.php for the Moodle site is correct?

When you go to select a theme, can you see the indevidual screenshots of the themes in the Theme Selector?

If not try enabeling Theme Designer Mode - TDM @ Theme Settings ...

Site Administration > Appearance > Themes > Theme settings ... TDM is 2nd from top...clisk to enable then scroll to bottom of page and save settings and once the page has reloaded, it may take a little while as the cache has been switched off, go back to HOME page. Hit Ctrl + F5 and force a reload of the home page. This should show up any images not visible before.

If the problem still persists...then it's not a cache thing, which I was rather thinking it could be.

HTH

Mary

 

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Moodle 2 upgrade problem - no images/icons loading

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I was assuming a standard theme... but you never know, some custom code could be behind this.

I'm sceptical about it being a cacheing issue as the error message is generated by the web server. That *shouldn't* ever be cached - but stranger things wink
In reply to Mary Evans

Re: Moodle 2 upgrade problem - no images/icons loading

by patricio sanz -

Hello Mary,

I can´t see any images in my moodle.

Can you explain me the correct permissions set? Ive change the permissions in some files, and now I see a blank page with characters with no theme at all!

I Cant see the indevidual screenshots of the themes in the Theme Selector.
Ive tried with your TDM explanation, but didnt work either.

Please help!

Patorius

In reply to Matthew Dumont

Re: Moodle 2 upgrade problem - no images/icons loading

by Art Vandelay -

Matthew, were you able to solve this? I'm on my 3rd fresh install, and still no icons anywhere... it seems that image.php is not working properly, but im fresh to moodle and know nothing smile

Ive encountered several posts with this issues, and none of the sugestions given solve my problem.

I'm using moodle 2.0 on Linux with PHP 5.2.17

In reply to Art Vandelay

Re: Moodle 2 upgrade problem - no images/icons loading

by Colin Fraser -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers

Could this be the same issue? http://moodle.org/mod/forum/discuss.php?d=178215

In which case could it be the build itself?

In reply to Colin Fraser

Re: Moodle 2 upgrade problem - no images/icons loading

by Art Vandelay -

I think it is something else, I have 2 diferent builds that have the same problem:
2.0.3+ (Build: 20110511)
2.0.3+ (Build: 20110623)

Chrome is receiving a 403 error (Forbidden) - I have attached a screenshot of the report.

Although I dont understand if the error is caused by the "image.php" or by the image itself.

I'll now try the official final 2.0.3 build of Moodle (20110505).

Attachment chromereport.png
In reply to Colin Fraser

Re: Moodle 2 upgrade problem - no images/icons loading

by Art Vandelay -

Same issue with the official build (20110505), and this time I noticed this early and didnt even need to go past the installation screen.

The strangest thing is that some icons are OK (GREEN circle) while others aren't (RED circle).

Im lost! How do I solve this?
Should I forget about 2.0 completly and go to 1.9?

Attachment Installation.jpeg
In reply to Art Vandelay

Re: Moodle 2 upgrade problem - no images/icons loading

by patricio sanz -

Hello Art,
I had your same problem and none of the sugestions given solve my problem either. I upgraded from moodle 2.0 to 2.0.3+ hoping that this update could the missing images issue.
I asked for support to my hosting provider, given the kind of errors, etc. and they got to the solution!!!!
The problem was a mod_security issue.
They are somewhat common, this sort of thing happens when legitimate coding methods appear to the server to be possible script injection. There seems to be an issue with the current modsec install on your server.
SOLUTION:
Recompiling it back in and then will get the rule violation whitelisted.
When recompile is complete the images returned, just like magic!!!
Ask your hosting provider to give you some advice, it is something that they have to solve.

Hope this helps you!

Patorius


 

In reply to patricio sanz

Re: Moodle 2 upgrade problem - no images/icons loading

by Art Vandelay -

Problem solved smile

Lesson learned... contact your Hosting provider describing the problem and the errors, they will fix it for you.

Thx again for the tip Patricio.

In reply to Art Vandelay

Re: Moodle 2 upgrade problem - no images/icons loading

by patricio sanz -

Don`t mention it wink

Patricio

In reply to patricio sanz

Re: Moodle 2 upgrade problem - no images/icons loading

by roc mehra -

suddenly my images is not showing.

HTTP Transfer Error - 151: 404 Not Found

error comes

 

In reply to roc mehra

Re: Moodle 2 upgrade problem - no images/icons loading

by Guillermo Madero -

Hi Roc,

"Suddenly"? Has some server or Moodle configuration been changed? Please provide more info.