File.php problems with IIS

File.php problems with IIS

by David Spaar -
Number of replies: 3

Hello,

I recently installed Moodle on my local machine running MySQL and IIS.  The software loaded with no major problems, and all my database tables were created during the configuration and setup.  I am now seeing a problem, however, in that it appears that IIS isn't interpreting the string paths being passed to file.php as an extension but as a full path, and the end result is that I keep getting 404 errors.

A coworker yesterday installed Moodle with MySQL and Apache, and he was able to run a test I had tried.  He had no problems, so obviously my configuration is somehow flawed.  I was hoping someone might have had a similar experience and can provide advice on how to fix it.  Thanks in advance for any help!  smile

Regards,
Dave

EDIT: sorry, just got on to turn off email receipt of postings to the forum, is there any other place than in editing a post that I can switch that option?

Average of ratings: -
In reply to David Spaar

Re: File.php problems with IIS

by Lawrence Wang -

Hello,

I'm testing out a moodle implementation on a Windows XP machine and I'm having the exact same issue.

Any updates on this?

I also believe it's some type of string path issue because pictures and documents are being stored in the moodle data folder correctly, but clicking the hyperlink where the path is displayed in the bottom status bar, yield a page not found error.

Example:

http://MyMoodleMachine/moodle/file.php/2/MyPowerPointFile.ppt?forcedownload=1

Note:

I am also using IIS and the moodle data folder is not in inetpub\wwwroot folder but the moodle data folder is correctly identified in the config.php file.

Mahalo,

Lawrence

Average of ratings: Useful (1)
In reply to Lawrence Wang

Re: File.php problems with IIS

by Bob Smith -

I'm fairly new to this myself so somebody please correct me if I'm wrong...

The issue is indeed occuring due to your "string path".  The example link you have posted contains what is called "Slash Arguments".  After file.php, the /2/MyPowerPointFile.ppt is actually an argument being passed to file.php.

The unfortunate thing is, that with URL Rewriting, IIS 6.0 does not support the slash argument configuration.  You can achieve URL Rewriting on IIS 6.0 when using the ISAPI Rewrite module however this negates the option of using FastCGI, which in my opinion is required if your site going to have any more than a few concurrent users.

So basically, I think the easiest way out for you will be to login to your moodle site as admin, in the Site Administration block, goto Server -> HTTP and disable the option for slash arguments.  This won't update any links you have already created on other resources so you'll need to delete / re-add those.

If your trying to access the file directly, you can now use a link like:

http://MyMoodleMachine/moodle/file.php?file=/2/MyPowerPointFile.ppt

See here for more information on the problem / URL Rewriting in IIS: http://moodle.org/mod/forum/discuss.php?d=80548

Hope This Helps,

Bob

Average of ratings: Useful (1)
In reply to Bob Smith

Re: File.php problems with IIS

by James Tadlock -

I was having the same problems as the other trying to run Moodle in XP. Like the others, the install went "OK" and everything seemed in place but the files could not be found with the resource hyperlink generated by the system.I think it worked. I got the file to display. Thank for the help. It took me a long time to dig out the answer from about 1000 places to look. I thank you but wish answere were easier to find.