Skip to content

Commit

Permalink
improve installation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikbosch committed Jul 30, 2024
1 parent b25672d commit fd362fc
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,37 @@
Uses [PHPER framework](https://github.com/phper-framework/phper) and [notify-rs](https://github.com/notify-rs/notify)
to build the extension. Supports PHP 8.1, 8.2 and 8.3 for Linux and macOS.

## Installation
## Build from source

In the release download the .so (Linux) or .dylib (macOS) file for your PHP version. Lookup the value of your
```shell
# For Debian/Ubuntu
sudo apt install gcc make llvm-13-dev libclang-13-dev protobuf-c-compiler protobuf-compiler

# For Alpine Linux
apk add gcc make musl-dev llvm15-dev clang15-dev protobuf-c-compiler

# For MacOS
brew install llvm@13
export LIBCLANG_PATH=$(brew --prefix llvm@13)/lib

# recommended rust setup, see https://www.rust-lang.org/tools/install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# build using cargo
cargo build --release

# move .so (Linux) or .so (MacOS) file to your extension dir
PHP_EXTENSION_DIR=`php -r "echo ini_get('extension_dir');"`
mv target/release/libphp_ext_fs_notify.so ${PHP_EXTENSION_DIR}/fs_notify.so
mv target/release/libphp_ext_fs_notify.dylib ${PHP_EXTENSION_DIR}/fs_notify.dylib

# enable the extension but putting in the ini file
echo 'extension=fs_notify.so' | tee -a /etc/php/${PHP_VERSION}/cli/conf.d/20-fs_notify.ini > /dev/null
```

## Install pre-created .so and .dylib

In the release download the .so (Ubuntu) or .dylib (macOS) file for your PHP version. Lookup the value of your
exension_dir, move the extension into that directory. Enable the extension by putting an ini-file in the conf.d folder
of your php version. It might look as follows.

Expand Down

0 comments on commit fd362fc

Please sign in to comment.