tags:

views:

515

answers:

4

For some reason one installation of Moodle 1.9.3+ has a problem that file.php returns a blank 0 byte file sometimes, even the apache log shows 0 bytes were returned. Another moodle installation works OK with the same htm files.

What could be causing this? Problematic files are just usual htm files - bug occurs with links like this:

http://server/file.php/164/moddata/scorm/4/data/msg.htm

(The problematic moodle was upgraded from 1.8 version earlier)

+2  A: 

A completely blank response may indicate a PHP error; check the PHP error log.

Rob
A: 

I've had this with a recent XAMP install, it did it whenever a file was saved as UTF8 (which my Visual Studio was doing automatically). Worked on every install apart from my test XAMP box though.

Steven Robbins
A: 

I had some problems with loading binary files with file.php, I think it showed up incorrectly as being 0 bytes (but I'm not sure). Turned out to be an extra new line character in the beginning of the jpg-files, the reason was a extra new line in the config.php file after the finishing ?>

I'm not a PHP-programmer but I've seen suggestions to remove the ending ?> in php-only files to minimize this kind of problem.

Hope it helps. Johan Carlsson

Johan Carlsson
A: 

Deactivate all filtes of your moodle system and test again.