Skip to content

Commit 9b93266

Browse files
authored
Merge pull request #22 from egmc/usage
update README about USE_ZEND_DTRACE=1
2 parents 93371fe + 45fa012 commit 9b93266

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,49 @@ This will:
5656

5757
## Usage
5858

59+
### Prerequisites
60+
61+
The target PHP process must have the `USE_ZEND_DTRACE=1` environment variable set. This enables USDT probes in the PHP runtime, which php-dcr uses to trace file compilation events.
62+
63+
#### Apache (systemd drop-in)
64+
65+
Create `/etc/systemd/system/apache2.service.d/dtrace.conf`:
66+
67+
```ini
68+
[Service]
69+
Environment=USE_ZEND_DTRACE=1
70+
```
71+
72+
You may need to preserve another variable that already set (like Ubuntu setting)
73+
74+
```ini
75+
[Service]
76+
Environment=APACHE_STARTED_BY_SYSTEMD=true USE_ZEND_DTRACE=1
77+
```
78+
79+
Then reload and restart:
80+
81+
```bash
82+
sudo systemctl daemon-reload
83+
sudo systemctl restart apache2
84+
```
85+
86+
#### PHP-FPM (systemd drop-in)
87+
88+
Create `/etc/systemd/system/php-fpm.service.d/dtrace.conf` (or `php8.3-fpm.service.d` etc. depending on your version):
89+
90+
```ini
91+
[Service]
92+
Environment=USE_ZEND_DTRACE=1
93+
```
94+
95+
Then reload and restart:
96+
97+
```bash
98+
sudo systemctl daemon-reload
99+
sudo systemctl restart php-fpm
100+
```
101+
59102
### Basic Usage
60103

61104
Run the program (requires root, `--target-dir` is required):
@@ -162,4 +205,4 @@ make clean
162205

163206
Apache License 2.0
164207

165-
Note: The eBPF program (`bpf/*`) declares "GPL" license for kernel compatibility.
208+
Note: The eBPF program (`bpf/*`) declares "GPL" license for kernel compatibility.

0 commit comments

Comments
 (0)