【发布时间】:2012-10-06 20:30:29
【问题描述】:
我在 Ubuntu(11.04 和 12.04)上缓冲所有 cgi 输出直到脚本终止时遇到问题。如果我在 Centos/rhel 6.2 apache2 上运行相同的脚本,它运行正常。
#!/usr/bin/perl
$|=1;
print "Content-type: text/html\r\n\r\n";
print "hi..";
sleep 1;
print "hi..";
sleep 1;
print "hi..";
sleep 1;
我已验证 mod_deflate 已禁用。
此外,这不仅仅是 perl 的事情,用 bash 编写的相同 cgi 脚本在 Ubuntu VS centos/rhel 上的行为相同。
【问题讨论】:
-
当 apache 运行你的脚本时会发生什么?
-
脚本完成后会打印所有内容。就像关闭缓冲一样。
标签: perl apache ubuntu buffering