Moodle file.php 返回一个空白的 0 字节文件
由于某种原因,Moodle 1.9.3+ 的安装有一个问题:file.php 有时会返回一个空白的 0 字节文件,甚至 apache 日志也显示返回了 0 字节。 另一个moodle安装可以使用相同的htm文件正常工作。
可能是什么原因造成的? 有问题的文件只是常见的 htm 文件 - 像这样的链接会出现错误:
http://server/file.php/164/moddata/scorm/4/data/msg.htm
(有问题的moodle是从早期的1.8版本升级的)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
完全空白的响应可能表明 PHP 错误; 检查 PHP 错误日志。
A completely blank response may indicate a PHP error; check the PHP error log.
我最近安装了 XAMP,每当文件保存为 UTF8 时(我的 Visual Studio 会自动执行此操作),它就会执行此操作。 除了我的测试 XAMP 盒子之外,每次安装都可以使用。
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.
我在使用 file.php 加载二进制文件时遇到了一些问题,我认为它错误地显示为 0 字节(但我不确定)。
原来是 jpg 文件开头的一个额外的换行符,
原因是完成后 config.php 文件中多了一个新行?>
我不是 PHP 程序员,但我看到过删除结尾 ?> 的建议。 在仅 php 文件中,以尽量减少此类问题。
希望能帮助到你。
约翰·卡尔森
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
停用 Moodle 系统的所有过滤器并再次测试。
Deactivate all filtes of your moodle system and test again.