Skip to content

Manual install

For boxes where the installer script is not wanted: everything is available as plain artifacts.

1. Prebuilt extension

GitHub releases ship a prebuilt phpray.so per combination of:

  • PHP version (8.1, 8.2, 8.3, 8.4 or 8.5; NTS builds only)
  • libc (glibc, musl)
  • architecture (amd64 today; arm64 builds of the extension follow, the collector already ships for both)

Example: phpray-8.3-glibc-amd64.so from https://phpray.dev/dl/v0.14.0/; the index is https://phpray.dev/dl/ (the current tag is in https://phpray.dev/dl/LATEST; every file is listed with its checksum in SHA256SUMS next to it). GitHub Releases will mirror the same files once the repository is public.

Place the .so into your extension_dir (see php -i | grep extension_dir) and add an ini snippet, e.g. /etc/php/8.3/fpm/conf.d/phpray.ini:

extension=phpray.so
phpray.enabled=1
phpray.mode=smart

Then restart the PHP workers (systemctl reload php8.3-fpm).

2. Collector

The phpray-collector binary (Go, static) is in the same release. Install it as /usr/local/bin/phpray-collector, give it a config file (/etc/phpray/collector.toml, see Collector) and a systemd unit:

[Unit]
Description=PHPRay collector
After=network.target

[Service]
ExecStart=/usr/local/bin/phpray-collector --config /etc/phpray/collector.toml
Restart=always
User=phpray

[Install]
WantedBy=multi-user.target

systemctl enable --now phpray-collector.

3. Docker

A base image is published: phpray/collector:0.14. Mount the volume where the shared memory lives (default /dev/shm/phpray) and the trace storage directory:

docker run -d --name phpray \
  -v /dev/shm/phpray:/dev/shm/phpray \
  -v /var/lib/phpray:/var/lib/phray \
  phpray/collector:0.14

The PHP extension itself must be present in the image that runs your app (copy the .so and ini snippet into your Dockerfile, or use the phpray/php:8.3 variant image).

4. Build from source

Requires php-dev (or phpize), gcc and a C compiler:

git clone https://github.com/phpray/phpray && cd phpray
phpize
./configure
make
sudo make install

Then add extension=phpray.so to your ini as above.