当我运行以下命令并一直提供一个空密码短语时:
mount -t ecryptfs /to/be/mounted /mount/location
我:
Passphrase:
Wrong input, non-empty value required!
Passphrase:
Wrong input, non-empty value required!
Passphrase:
Wrong input, non-empty value required!
太好了!但是,当我尝试从PHP脚本中使用以下代码执行相同的操作时:
#!/usr/bin/php
<?php
system("mount -t ecryptfs /to/be/mounted /mount/location");
?>
我:
Wrong input, non-empty value required!
Wrong input, non-empty value required!
Wrong input, non-empty value required!
Passphrase:
Passphrase:
Passphrase:
不太棒了!如何让PHP在正确的时间以正确的顺序显示输出?
也许它涉及到,当PHP作为服务器模块与CGI运行时,system()调用试图在每一行输出后自动刷新web服务器的输出缓冲区。