我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

用php中的inotify读取linux中的文件

I need to read a file in linux when changes are made to it and output the contents of the file to php. I read about inotify and i think it's the one i'm looking for. I don't understand it well. do i need to install inotify in linux so i can use inotify in php?.. if possible can you show me a quick example of how i use it in php for reading/tailing a file in php for events that occured in the file?.

Thanks,

You can use shell/bash in PHP:

$shell = shell_exec("cat file");
print $shell

近期文章

  • 时区问题使用unix时间,php,mysql
  • Jquery可排序还原portlet到已保存的设置
  • 从Heroku外部连接到cPanel服务器上的MySQL数据库?
  • php if语句或运算符
  • 在Facebook上实时,动态生成图像共享
  • Magento - 边栏类别过滤器,URL不是从root开始的
  • 如何操作example.com/search/?s=some到example.com/search/some的URL
  • 如何将库存水平更新日期添加到前端
  • 需要帮助了解Magento产品集合对象和目录/产品模型
  • 如何使用ajax立即获取数据?
  • 访问公用文件夹的子域
  • $ oauth-> fetch的问题
  • PHP copy()最大大小问题
  • 在我的webapp中存储例外?
  • Prestashop - 自定义模板链接
  • 使用JQuery从post()接收响应
  • 使用PHP PDF函数创建简单表
  • 将Evercookie值传递出函数
  • 如何使用PHP作为可用变量获取mysql列的总和
  • 为什么我的函数beginLoading从不做可见的动作?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华