Moodle file.php 返回一个空白的 0 字节文件

发布于 2024-07-10 10:48:15 字数 373 浏览 4 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

还如梦归 2024-07-17 10:48:15

完全空白的响应可能表明 PHP 错误; 检查 PHP 错误日志。

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

无人问我粥可暖 2024-07-17 10:48:15

我最近安装了 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.

哑剧 2024-07-17 10:48:15

我在使用 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

怎樣才叫好 2024-07-17 10:48:15

停用 Moodle 系统的所有过滤器并再次测试。

Deactivate all filtes of your moodle system and test again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文