当对文件进行更改时,我需要在 linux 中读取文件并将文件的内容输出到 php。我阅读了有关 inotify 的信息,我认为这是我正在寻找的。我不太明白。我需要在 linux 中安装 inotify 以便我可以在 php 中使用 inotify 吗?..如果可能的话,你能给我一个快速示例,说明我如何在 php 中使用它来读取/跟踪文件中发生的事件的 php 文件吗? .
谢谢,
最佳答案
您可以在 PHP 中使用 shell
/bash
:
$shell = shell_exec("cat file");
print $shell
关于php - 在 linux 中使用 inotify 在 php 中读取文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12740179/