Moodle 2 - no images displayed.

Moodle 2 - no images displayed.

by Steve Lawrence -
Number of replies: 26

Hi,

While trying to solve database issues with an upgrade, I am attempting to set up a blank Moodle 2.3 installation to try various options.

This happens with all versions of 2 and happens if I am upgrading a copy of my 1.9 installation or installing clean. All images in Moodle 2's themes are displayed as (image not found) red crosses.

When loading the image separately in another tab I get a 404 error. All permissions appear to be correct (I even set an everyone full control to test).

Other similar issues here seem to have been solved by disabling mod_security but I am using IIS 7 and don't seem to have that option (or can't "translate" it from an Apache setting).

Any help please? Many thanks.

Average of ratings: -
In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Luis de Vasconcelos -

I tried installing the latest 2.4 DEV this afternoon and experienced a similar "broken" images/css problem. Haven't figured out the problem yet. (But it is a pre-release version so problems are to be expected...) The 2.1 instance that I have on that same computer is fine. Both sites are running on the same IIS and MSSQL instance.

Try installing a blank instance of the latest Moodle 2.2 build and see if you experience the same "broken" images/css problem with that version.

In reply to Luis de Vasconcelos

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

I've tried it with 2.0, 2.1, 2.2 and 2.3.  I get the same problem every time.  1.9 works fine.  Getting rather frustrated with this.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

Correction: I have IIS 7.5.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

Judging by the Moodle logo at the bottom of the page, images seem to work right up until I write the config.  I've written it manually and let it create it itself.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

1. Switch on Debugging in Moodle

2. Right click on the little X (or whatever) that marks the missing image and select 'open in new tab/window'.


What happens? If just a blank page, check your web server error log too.

In reply to Howard Miller

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

Hi Howard,

Thanks for the reply, but I already did that and it's a 404 error (it's in my first post).  I can't find anything in the server logs and debug mode is not giving me anything.

I don't think the style sheet is loading either because I just have a list of options down the page with none of the collapsing of menus from 1.9. 

 

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

Usually the problem is in config.php ... for example :

- there should be no last php end tags ( ?> ) in any php files of moodle 2.X and particularly not in config.php

- config.php may be in a wrong file format, it should be saved as an ANSI file, not UTF-8 or UTF-8 with BOM ... some text editors may change the format when you edit and save config.php

- config.php may have whitespaces or some extra code before the first php tags

- you may need to purge all caches either from administration menu of moodle or from moodledata/cache folder

Check also that paths in config.php are correct and that you have given the permissions for actual IIS_USER. You might find some "real" URL of non-existing image if you use mouse right click - Properties over image place holder in IE if opening in a new tab leads to 404 page

And if none of this helps the reason might be in some server side setting or url rewrite script but it's much more difficult to quess it without access to your server - or source code (in your browser you can view the source and for example yui css could be broken by some minifier scripts etc)

In reply to Mauno Korpelainen

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

Thanks Mauno,

  • No last tags.
  • Saved and re-saved in both ANSI and UTF-8.
  • Nothing before <?php
  • All paths are correct.

Hmm.  Purge All Caches menu option returns a 404... (Moodledate/cache cleared manually, no change.)

No IIS_USER in IIS7.5 (apparently it uses the Users group? which has read/execute permissions) but I have tested with everyone Full Control.

The install I'm testing is a sub folder of our 1.9 install which is running fine and permissions are inherited from that.

Are there any definitive instructions on how to set up IIS for Moodle 2 - i.e. ALL the options and settings?

This is the <head> from view source.

<head>

<title>Moodle 2</title>

<meta name="description" content="Moodle 2" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="moodle, Moodle 2" />
<script id="firstthemesheet" type="text/css">/** Required in order to fix style inclusion problems in IE with YUI **/</script><link rel="stylesheet" type="text/css" href="http://stmichaelsrc.sbcschools.org.uk/moodle2/theme/styles.php?theme=standard&amp;rev=281" />
<script type="text/javascript">
//<![CDATA[
var M = {}; M.yui = {}; var moodleConfigFn = function(me) {var p = me.path, b = me.name.replace(/^moodle-/,'').split('-', 3), n = b.pop();if (/(skin|core)/.test(n)) {n = b.pop();me.type = 'css';};me.path = b.join('-')+'/'+n+'/'+n+'.'+me.type;}; var galleryConfigFn = function(me) {var p = me.path,v=M.yui.galleryversion,f;if(/-(skin|core)/.test(me.name)) {me.type = 'css';p = p.replace(/-(skin|core)/, '').replace(/\.js/, '.css').split('/'), f = p.pop().replace(/(\-(min|debug))/, '');if (/-skin/.test(me.name)) {p.splice(p.length,0,v,'assets','skins','sam', f);} else {p.splice(p.length,0,v,'assets', f);};} else {p = p.split('/'), f = p.pop();p.splice(p.length,0,v, f);};me.path = p.join('/');};
M.yui.loader = {"base":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/lib\/yui\/3.4.1\/build\/","comboBase":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?","combine":true,"filter":"RAW","insertBefore":"firstthemesheet","modules":{"yui2-event":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/event\/event-min.js"},"yui2-animation":{"type":"js","requires":["yui2-dom","yui2-event"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/animation\/animation-min.js"},"yui2-swfstore":{"type":"js","requires":["yui2-element","yui2-cookie","yui2-swf"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/swfstore\/swfstore-min.js"},"yui2-datatable":{"requires":["yui2-element","yui2-datasource"],"type":"js","optional":["yui2-calendar","yui2-dragdrop","yui2-paginator"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/datatable\/datatable-min.js"},"yui2-swfdetect":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/swfdetect\/swfdetect-min.js"},"yui2-menu":{"requires":["yui2-containercore"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/menu\/menu-min.js"},"yui2-treeview":{"requires":["yui2-event","yui2-dom"],"type":"js","optional":["yui2-json","yui2-animation","yui2-calendar"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/treeview\/treeview-min.js"},"yui2-get":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/get\/get-min.js"},"yui2-progressbar":{"requires":["yui2-element"],"type":"js","optional":["yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/progressbar\/progressbar-min.js"},"yui2-uploader":{"type":"js","requires":["yui2-element"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/uploader\/uploader-min.js"},"yui2-datasource":{"requires":["yui2-event"],"type":"js","optional":["yui2-connection"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/datasource\/datasource-min.js"},"yui2-profiler":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/profiler\/profiler-min.js"},"yui2-connection":{"supersedes":["yui2-connectioncore"],"requires":["yui2-event"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/connection\/connection-min.js"},"yui2-json":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/json\/json-min.js"},"yui2-datemath":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/datemath\/datemath-min.js"},"yui2-calendar":{"supersedes":["yui2-datemath"],"requires":["yui2-event","yui2-dom"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/calendar\/calendar-min.js"},"yui2-simpleeditor":{"requires":["yui2-element"],"type":"js","optional":["yui2-containercore","yui2-menu","yui2-button","yui2-animation","yui2-dragdrop"],"pkg":"editor","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/editor\/simpleeditor-min.js"},"yui2-swf":{"supersedes":["yui2-swfdetect"],"requires":["yui2-element"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/swf\/swf-min.js"},"yui2-event-simulate":{"type":"js","requires":["yui2-event"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/event-simulate\/event-simulate-min.js"},"yui2-yuiloader-dom-event":{"supersedes":["yui2-yahoo","yui2-dom","yui2-event","yui2-get","yui2-yuiloader","yui2-yahoo-dom-event"],"rollup":5,"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/yuiloader-dom-event\/yuiloader-dom-event.js"},"yui2-storage":{"requires":["yui2-yahoo","yui2-event","yui2-cookie"],"type":"js","optional":["yui2-swfstore"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/storage\/storage-min.js"},"yui2-container":{"supersedes":["yui2-containercore"],"requires":["yui2-dom","yui2-event"],"type":"js","optional":["yui2-dragdrop","yui2-animation","yui2-connection"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/container\/container-min.js"},"yui2-profilerviewer":{"requires":["yui2-profiler","yui2-yuiloader","yui2-element"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/profilerviewer\/profilerviewer-min.js"},"yui2-imagecropper":{"requires":["yui2-dragdrop","yui2-element","yui2-resize"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/imagecropper\/imagecropper-min.js"},"yui2-paginator":{"requires":["yui2-element"],"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/paginator\/paginator-min.js"},"yui2-tabview":{"requires":["yui2-element"],"type":"js","optional":["yui2-connection"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/tabview\/tabview-min.js"},"yui2-layout":{"requires":["yui2-element"],"type":"js","optional":["yui2-animation","yui2-dragdrop","yui2-resize","yui2-selector"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/layout\/layout-min.js"},"yui2-imageloader":{"type":"js","requires":["yui2-event","yui2-dom"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/imageloader\/imageloader-min.js"},"yui2-containercore":{"requires":["yui2-dom","yui2-event"],"type":"js","pkg":"container","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/container\/container_core-min.js"},"yui2-event-mouseenter":{"type":"js","requires":["yui2-dom","yui2-event"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/event-mouseenter\/event-mouseenter-min.js"},"yui2-logger":{"requires":["yui2-event","yui2-dom"],"type":"js","optional":["yui2-dragdrop"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/logger\/logger-min.js"},"yui2-cookie":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/cookie\/cookie-min.js"},"yui2-stylesheet":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/stylesheet\/stylesheet-min.js"},"yui2-connectioncore":{"requires":["yui2-event"],"type":"js","pkg":"connection","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/connection\/connection_core-min.js"},"yui2-utilities":{"supersedes":["yui2-yahoo","yui2-event","yui2-dragdrop","yui2-animation","yui2-dom","yui2-connection","yui2-element","yui2-yahoo-dom-event","yui2-get","yui2-yuiloader","yui2-yuiloader-dom-event"],"rollup":8,"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/utilities\/utilities.js"},"yui2-dragdrop":{"type":"js","requires":["yui2-dom","yui2-event"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/dragdrop\/dragdrop-min.js"},"yui2-colorpicker":{"requires":["yui2-slider","yui2-element"],"type":"js","optional":["yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/colorpicker\/colorpicker-min.js"},"yui2-event-delegate":{"requires":["yui2-event"],"type":"js","optional":["yui2-selector"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/event-delegate\/event-delegate-min.js"},"yui2-yuiloader":{"type":"js","supersedes":["yui2-yahoo","yui2-get"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/yuiloader\/yuiloader-min.js"},"yui2-button":{"requires":["yui2-element"],"type":"js","optional":["yui2-menu"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/button\/button-min.js"},"yui2-resize":{"requires":["yui2-dragdrop","yui2-element"],"type":"js","optional":["yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/resize\/resize-min.js"},"yui2-element":{"requires":["yui2-dom","yui2-event"],"type":"js","optional":["yui2-event-mouseenter","yui2-event-delegate"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/element\/element-min.js"},"yui2-history":{"type":"js","requires":["yui2-event"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/history\/history-min.js"},"yui2-yahoo":{"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/yahoo\/yahoo-min.js"},"yui2-element-delegate":{"type":"js","requires":["yui2-element"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/element-delegate\/element-delegate-min.js"},"yui2-charts":{"type":"js","requires":["yui2-element","yui2-json","yui2-datasource","yui2-swf"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/charts\/charts-min.js"},"yui2-slider":{"requires":["yui2-dragdrop"],"type":"js","optional":["yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/slider\/slider-min.js"},"yui2-selector":{"type":"js","requires":["yui2-yahoo","yui2-dom"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/selector\/selector-min.js"},"yui2-yuitest":{"requires":["yui2-logger"],"type":"js","optional":["yui2-event-simulate"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/yuitest\/yuitest-min.js"},"yui2-carousel":{"requires":["yui2-element"],"type":"js","optional":["yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/carousel\/carousel-min.js"},"yui2-autocomplete":{"requires":["yui2-dom","yui2-event","yui2-datasource"],"type":"js","optional":["yui2-connection","yui2-animation"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/autocomplete\/autocomplete-min.js"},"yui2-yahoo-dom-event":{"supersedes":["yui2-yahoo","yui2-event","yui2-dom"],"rollup":3,"type":"js","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/yahoo-dom-event\/yahoo-dom-event.js"},"yui2-dom":{"type":"js","requires":["yui2-yahoo"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/dom\/dom-min.js"},"yui2-editor":{"supersedes":["yui2-simpleeditor"],"requires":["yui2-menu","yui2-element","yui2-button"],"type":"js","optional":["yui2-animation","yui2-dragdrop"],"fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?2.9.0\/build\/editor\/editor-min.js"},"core_filepicker":{"name":"core_filepicker","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/lib\/javascript.php?file=%2Frepository%2Ffilepicker.js&rev=280","requires":["base","node","node-event-simulate","json","async-queue","io-base","io-upload-iframe","io-form","yui2-button","yui2-container","yui2-layout","yui2-menu","yui2-treeview","yui2-dragdrop","yui2-cookie"]},"core_dock":{"name":"core_dock","fullpath":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/lib\/javascript.php?file=%2Fblocks%2Fdock.js&rev=280","requires":["base","node","event-custom","event-mouseenter","event-resize"]}},"groups":{"moodle":{"name":"moodle","base":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?moodle\/280\/","comboBase":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?","combine":true,"filter":"","ext":false,"root":"moodle\/280\/","patterns":{"moodle-":{"group":"moodle","configFn":moodleConfigFn},"root":"moodle"}},"local":{"name":"gallery","base":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/lib\/yui\/gallery\/","comboBase":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/yui_combo.php?","combine":true,"filter":"RAW","ext":false,"root":"gallery\/","patterns":{"gallery-":{"group":"gallery","configFn":galleryConfigFn},"root":"gallery"}}}};
M.cfg = {"wwwroot":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2","sesskey":"C60elZ3fPi","loadingicon":"http:\/\/stmichaelsrc.sbcschools.org.uk\/moodle2\/theme\/image.php?theme=standard&image=i%2Floading_small&rev=281","themerev":"281","theme":"standard","jsrev":"280","developerdebug":true};
//]]>
</script>
</head>
In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

You might need that IIS_USER or IUSER - what ever it is called...

If you download from http://www.bfcnetworks.com/whitepapers/installing-moodle-2-on-windows-server-mysql-php-and-iis7/ and there link Click to download PDF a pdf document you should find from page 10 some info about setting up IUSER account.

I am not sure if this alone explains your case but at least it sounds like an IIS permission issue...

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

You could also try to disable yui combo loading from Site administration > Appearance > AJAX and Javascript (or to set enable theme designer mode from theme settings) to see if separate css files are loaded better without yui combo script... for some reason IE debugging (F12) gives yui error on your site

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

I visited your site and was suprised to see that some files/images are found but some are not...

For example in moodle.org h t t p s : / / moodle.org/theme/afterburner/pix/footer/moodle-logo.png shows moodle-logo but on your site h t t p : / / stmichaelsrc.sbcschools.org.uk/moodle2/theme/afterburner/pix/footer/moodle-logo.png shows no moodle logo

On the other hand for example h t t p : / / stmichaelsrc.sbcschools.org.uk/moodle2/pix/moodlelogo.gif does render moodlelogo

Are you sure that all files of moodle 2 package are in a correct place, particularly the sub folders of theme folder?

In reply to Mauno Korpelainen

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

And if you try to access directly files like https://moodle.org/lib/yui/3.5.1/build/cssreset/reset-min.css here you get that css file but on your site

http://stmichaelsrc.sbcschools.org.uk/moodle2/lib/yui/3.4.1/build/cssreset/reset.css (that source is trying to find) is not found.

Is IIS actually just telling that those files are really missing from your server?

In reply to Mauno Korpelainen

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

None of the AJAX and Javascript settings seem to make any noticeable difference.

Those two specific files you mentioned do exist and appear fine when browsing to the file path rather than the url.

Adding IUSR does not make any difference.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This can't be that difficult.... Let's take an example...

http://stmichaelsrc.sbcschools.org.uk/moodle2/theme/image.php

...returns a 404 error. It might not do anything useful without parameters but a 404 error should never happen, so let's work out why.

Firstly, immediately after generating this error. What is in your web server error log? If you say nothing I won't believe you. You must be looking in the wrong place or your server is broken. Errors like this are always logged.

Some thoughts... does that file *really* exist and is it accessible? Does it have the correct permissions (the log entry should tell you all this anyway)? Do you have any other .htaccess files or IIS equivalent or other settings you might have forgotten about? For example, Wordpress .htaccess file wreak havoc with Moodle if they affect the same folders.

In reply to Howard Miller

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

The file is definately there.  It has read & execute security permissions for IUSR and Users.

File location

This is the IIS log entry for that file/access.

2012-11-09 11:57:20 10.64.162.10 GET /moodle2/theme/image.php - 80 - 10.64.162.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+BTRS120924;+.NET+CLR+2.0.50727;+.NET4.0C;+.NET4.0E;+InfoPath.1;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) 404 0 2 202

This server has nothing but Moodle on it and it has barely been touched for a year while hosting 1.9 - almost everything was managed via Moodle.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

Something in these paths simply does not seem to "match" - in this screenshot the files are in folder F:\inetpub\MOODLE\Moodle2\theme which probably means that your webroot of IIS is set to F:\inetpub\MOODLE. Usually the webroot of IIS is in C:\inetpub\wwwroot.

But it makes no sense that some files (not only images) like stmichaelsrc.sbcschools.org.uk/moodle2/mod/resource/readme.txt are not found (direct access) but some files like stmichaelsrc.sbcschools.org.uk/moodle2/mod/README.txt are found - unless if you had several copies of moodle 2 packages and some files were missing or if different folders had different permissions (not inherited from parent folders). But I have never really understood how IIS is setting server permissions for "special folders" - see http://support.microsoft.com/kb/981949

In reply to Mauno Korpelainen

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

Our working 1.9 install is F:/inetpub/MOODLE at http://stmichaelsrc.sbcschools.org.uk/

The Moodle2 test install is a sub folder of that and the config wwwroot for Moodle2 points to http://stmichaelsrc.sbcschools.org.uk/moodle2

Inetpub/MOODLE was put on F:\ along with MoodleData as it has more space and makes backing up easier.  Keep the data away from the OS and all together.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

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'm not very familiar with IIS but that is the access log. Surely IIS has an *error* log somewhere?

At a glance - http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/bcabdcfb-2421-4eab-b5fb-777c791daaa9.mspx?mfr=true


I know it's not a big concern on Windows but it's not something I like to see - your directory is 'Moodle2' and your wwwroot setting has 'moodle2'. I'd be a lot happier if your paths matched your directory names in case as well.

The dates of those files is making me wonder as well. *Exactly* which build/version of 2.3 is this? I wondered if that had just filtered through in a zip file, but there were no modifications to image.php during December 2011, so where did it get that date and why are all the other file dates so different?

AND... my image.php file is 8.4K. I have to go back to Moodle 2.2 to see it as 7K!! SO... please tell me this isn't a totally mucked up Moodle directory. Have you tried, dumping this Moodle code and replacing it with a completely clean copy of 2.3 just to make sure??

In reply to Howard Miller

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

I have been deleting and reinstalling every version of 2.x I can find, it just so happens that the last one was 2.2.5.

It doesn't work for any of them as I mentioned in the first post.  The problem, whatever it is, is almost certainly going to be the same and if we can fix it for 2.2.5 or 2.1.8 then I am confident that it will work for 2.3.x.

Besides, I need to get at least 2.2.x working as I am originally tried to upgrade from 1.9 if we can ever get those errors sorted as well.  This separate/clean 2.x install was only intended as a test (because I get the same problems as this during the upgrade, as well as the database issues).

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

So.... having established that.... have you tracked down that error log yet?

In reply to Howard Miller

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

That's from the IIS log set in the IIS Manager.  There's nothing relating to IIS in the Event Viewer.

What exactly are you looking for?

This is the Detailed Error from localhost for the image.php as above.

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Detailed Error Information
Module IIS Web Core
Notification MapRequestHandler
Handler PHP_via_FastCGI
Error Code 0x80070002
Requested URL http://localhost:80/moodle2/theme/image.php
Physical Path F:\inetpub\MOODLE2\theme\image.php
Logon Method Anonymous
Logon User Anonymous

Now that is looking for F:\inetpub\MOODLE2\theme\image.php when it's actually at F:\inetpub\MOODLE\MOODLE2\theme\image.php

Where is it picking that path up from? 

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

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 the root of the problem staring you in the face.

Physical Path F:\inetpub\MOODLE2\theme\image.php

That isn't the folder you showed us above. How did http://localhost:80/moodle2/theme/image.php get mapped to the physical location F:\inetpub\MOODLE2\theme\image.php??

This has to be a problem in your IIS configuration.

In reply to Howard Miller

Re: Moodle 2 - no images displayed.

by Steve Lawrence -

It was a problem in the IIS Virtual Directory physical path.  I had checked that and recreated it several times.  I really don't know how/when that changed, must have got complacent the last time. Thank you for the pointers. 

That's working now. Still doesn't help with the upgrade, but at least we can test 2.x.

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mauno Korpelainen -

Those paths in your screenshot and in this url request are different:

F:\inetpub\MOODLE2\theme\image.php VS F:\inetpub\MOODLE\Moodle2\theme\image.php

And http://localhost:80/moodle2/theme/image.php is not probably the same as http://stmichaelsrc.sbcschools.org.uk/moodle2/theme/image.php

Is there some kind of url rewrite rule / server cache enabled ?

In reply to Mauno Korpelainen

Re: Moodle 2 - no images displayed.

by Bea Stephan -

No last php end tags ( ?> ) in php files of moodle 2.X and particularly not in config.php, worked for me!  After a dbase and server move all images looked broken. Fixed with this tip from Mauno Korpelainen. Thanks

In reply to Steve Lawrence

Re: Moodle 2 - no images displayed.

by Mark van Hoek -
Picture of Core developers Picture of Plugin developers

In my case on IIs 7.5 it turned out that I (or maybe Moodle) had saved config.php with UTF-8 encoding.  I re-saved it with Western European (Windows), which is Windows-1252, and that fixed the problem right away. That may not be the best character encoding to choose, and others may work as well.