Skip to content

Commit ca37c60

Browse files
committed
improve install docs
1 parent 1383c07 commit ca37c60

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
Uses [PHPER framework](https://github.com/phper-framework/phper) and [notify-rs](https://github.com/notify-rs/notify)
44
to build the extension.
55

6+
## Installation
7+
8+
In the release download the .so (Linux) or .dylib (macOS) file for your PHP version. Lookup the value of your
9+
exension_dir, move the extension into that directory. Enable the extension by putting an ini-file in the conf.d folder
10+
of your php version. It might look as follows.
11+
12+
```shell
13+
PHP_VERSION=`php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;"`
14+
PHP_EXTENSION_DIR=`php -r "echo ini_get('extension_dir');"`
15+
16+
# download the extension file into the extension dir
17+
curl -o "${PHP_EXTENSION_DIR}/libphp_ext_fs_notify.so" "https://github.com/genkgo/php-ext-fs-notify/releases/latest/download/linux-php${PHP_VERSION}-libphp_ext_fs_notify.so"
18+
19+
# enable the extension
20+
echo 'extension=libphp_ext_fs_notify.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-libphp_ext_fs_notify.ini
21+
```
22+
623
## Usage
724

825
Create watcher, add paths to watch and start watching with a callback.

0 commit comments

Comments
 (0)