inotify检测文件或目录修改事件

时间:2019-09-12 13:40:58

标签: php raspberry-pi3 inotify

我的固件程序使用的是python3。使用需要在HMI显示器上运行的基于Chrome浏览器的UI。 UI(用PHP,jQuery和HTML制造)和固件之间的通信是通过文件读写操作完成的。我的想法是在php和python中都使用iNotify库来检测特定文件中的任何更改。

在python中,它已实现且运行良好。 当我打算使用sudo pecl install inotify命令为PHP安装iNotify时,出现以下错误。

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/inotify.so' - /usr/lib/php/20151012/inotify.so: cannot open shared object file: No such file or directory in Unknown on line 0
downloading inotify-2.0.0.tgz ...
Starting to download inotify-2.0.0.tgz (8,836 bytes)
.....done: 8,836 bytes
3 source files, building
running: phpize
sh: 1: phpize: not found
ERROR: `phpize' failed

我经历了https://askubuntu.com/questions/885574/ ... n-for-php7和https://stackoverflow.com/questions/310 ... run-phpize上给出的解决方案,但是失败了。

如何在PHP和RPi中安装inotify?还有其他方法可以检测特定文件或目录中的更改吗?

PHP7.0已安装在我的RPi中,并使用https://www.simplicity.be/article/watch ... ories-php /中提供的示例来监视文件或目录。

我想将监视放在/var/www/html/js目录中。该目录中可能有8或9个文件,只需要监视3个文件即可。

任何帮助或建议将不胜感激。

0 个答案:

没有答案
相关问题