inotify - 如何在 PHP7.4 中使用 inotify
问题描述
我在 PHP 7.3.x 中使用 PECL 扩展inotify
没有任何问题。我更新到 PHP 7.4 但我没有成功获得inotify
为构建编译的扩展,20190902
因为 PECL 命令sudo pecl upgrade inotify
说有
没什么可升级的
那么我怎样才能获得这个扩展呢?
解决方案
我通过从源代码编译它来工作。你可以在这里下载最新版本(我应该>=2.0.0
相信)。
解压下载的文件.tgz
,进入解压后的文件夹,然后继续执行以下命令:
phpize7.4 # this is the important command
./configure
make clean
make
make install
这将编译库20190902
并将其安装在/usr/lib/php/20190902
:
$ ls /usr/lib/php/20190902/ | grep inotify
inotify.so
我相信你知道如何启用扩展;但如果你不这样做,首先你需要创建一个/etc/php/7.4/mods-available
名为的文件,inotify.ini
其中包含以下内容:extension=inotify.so
为了引用 mod。所以它看起来像这样:
$ cat /etc/php/7.4/mods-available/inotify.ini
extension=inotify.so
然后您可以在 7.4 版中为每个 SAPI 启用该 mod phpenmod -v 7.4 -s ALL inotify
:. 可能然后重置php7.4-fpm
等。
推荐阅读
- hashicorp-vault - 重新初始化后如何解封保险库?
- php - CodeIgniter 添加由基于登录用户编辑创建的
- sql - 带有 OFFSET 的 PostgreSQL LIMIT 不能超过 100000
- python - 我不知道为什么 var = int(input()) 是错误的
- java - 无法在 JSoup 中选择 div 的子项
- c# - MSBuild v4.0.30319 - 命名空间中不存在类型或命名空间“Fakes”
- google-apps-script - Google Directory API - 搜索用户 - 排除子组织单位
- c# - 是否使用带有异步任务和等待的 ConfigureAwait(false) 传播异常?
- apache-kafka - Kafka 指标 RequestHandlerAvgIdlePercent
- javascript - ES6 - 使用 javascript es6 从基于键名的数组创建新数组