You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Linux x86_64 |`harphp-linux-x86_64`| Fully static (musl), most portable |
30
+
| Linux x86_64 |`harphp-linux-x86_64-gnu`| glibc-linked, supports dynamic extensions |
31
+
| Linux ARM64 |`harphp-linux-aarch64`| Fully static (musl), for ARM64/aarch64 |
32
+
33
+
### From Source (requires PHP 8.1+)
34
+
13
35
```bash
14
36
composer install
15
37
chmod +x bin/harphp
16
38
```
17
39
18
40
## Usage
19
41
42
+
> **Note:** If using the standalone binary, replace `bin/harphp` with:
43
+
> ```bash
44
+
> ./harphp-linux-x86_64 php-cli /app/bin/harphp
45
+
>```
46
+
20
47
### List requests
21
48
22
49
```bash
@@ -174,6 +201,117 @@ Options:
174
201
--response-body Show response body
175
202
```
176
203
204
+
## Building Standalone Executable
205
+
206
+
harphp can be compiled into a fully standalone executable using FrankenPHP. The resulting binary includes the PHP runtime and all dependencies, requiring no external PHP installation.
207
+
208
+
### Prerequisites
209
+
210
+
- Docker (for building)
211
+
212
+
### Build Commands
213
+
214
+
```bash
215
+
# Build for your current platform (Linux musl - fully static)
216
+
./build.sh
217
+
218
+
# Build with glibc (for dynamic extension support)
219
+
LIBC=gnu ./build.sh
220
+
221
+
# Cross-compile for different architectures
222
+
TARGET_ARCH=aarch64 ./build.sh # ARM64
223
+
TARGET_ARCH=x86_64 ./build.sh # x86_64
224
+
```
225
+
226
+
### Using the Standalone Binary
227
+
228
+
After building, the executable is available at `dist/harphp`:
|`LIBC`| C library variant: `musl` (static) or `gnu` (dynamic) |`musl`|
242
+
|`TARGET_OS`| Target OS: `linux` or `mac`| Current OS |
243
+
|`TARGET_ARCH`| Target architecture: `x86_64` or `aarch64`| Current arch |
244
+
245
+
### Binary Size
246
+
247
+
The standalone binary is approximately 30-50MB depending on included extensions. For production deployment, you can further reduce size using UPX compression:
248
+
249
+
```bash
250
+
upx --best dist/harphp
251
+
```
252
+
253
+
## Contributing
254
+
255
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automatic versioning and changelog generation.
256
+
257
+
### Commit Message Format
258
+
259
+
```
260
+
<type>(<scope>): <description>
261
+
262
+
[optional body]
263
+
264
+
[optional footer(s)]
265
+
```
266
+
267
+
### Commit Types
268
+
269
+
| Type | Description | Version Bump |
270
+
|------|-------------|--------------|
271
+
|`feat`| New feature | Minor (0.x.0) |
272
+
|`fix`| Bug fix | Patch (0.0.x) |
273
+
|`docs`| Documentation only | None |
274
+
|`style`| Code style (formatting) | None |
275
+
|`refactor`| Code refactoring | None |
276
+
|`perf`| Performance improvement | Patch |
277
+
|`test`| Adding tests | None |
278
+
|`chore`| Maintenance tasks | None |
279
+
|`ci`| CI/CD changes | None |
280
+
281
+
### Breaking Changes
282
+
283
+
Add `!` after the type or include `BREAKING CHANGE:` in the footer for major version bumps:
284
+
285
+
```
286
+
feat!: remove deprecated filter syntax
287
+
288
+
BREAKING CHANGE: The old filter syntax is no longer supported.
289
+
```
290
+
291
+
### Examples
292
+
293
+
```bash
294
+
# Feature (minor version bump)
295
+
git commit -m "feat: add JSON output format for requests command"
296
+
297
+
# Bug fix (patch version bump)
298
+
git commit -m "fix: handle empty HAR files gracefully"
299
+
300
+
# Breaking change (major version bump)
301
+
git commit -m "feat!: change default output format to compact JSON"
302
+
```
303
+
304
+
### Release Process
305
+
306
+
Releases are automated via GitHub Actions:
307
+
308
+
1. Push commits to `main` using conventional commit messages
309
+
2. Release Please creates/updates a release PR with changelog
310
+
3. Merge the release PR to trigger:
311
+
- Version bump in `composer.json` and `src/Application.php`
0 commit comments