phrust-php is the PHP-compatible command-line front door. It accepts common
PHP CLI flags and executes code through the workspace frontend, runtime, and VM.
nix develop -c cargo run -p php_vm_cli --bin phrust-php -- path/to/file.php
nix develop -c cargo run -p php_vm_cli --bin phrust-php -- -r 'echo PHP_VERSION, "\n";'
printf '<?php echo "stdin\n";' | nix develop -c cargo run -p php_vm_cli --bin phrust-php --The debug executable built by Cargo is:
target/debug/phrust-php
phrust-php -v
phrust-php --ini
phrust-php -c php.ini -d display_errors=1 script.php
phrust-php -l script.php
phrust-php -m
phrust-php -i
phrust-php -S 127.0.0.1:8080 -t publicThe -c loader intentionally supports a minimal deterministic subset:
include_path, display_errors, and error_reporting. Blank lines, comments,
and sections are ignored. Repeated -d values override values loaded from -c.
--ri, --rf, and --rc are recognized and fail with a stable unsupported
diagnostic until reflection-style CLI introspection is implemented.
nix develop -c just install-user-bin
export PATH="$PWD/target/phrust/bin:$PATH"
php -vThe shim only changes the shell where the exported PATH is active. It does
not install into system directories.
php-vm remains available for lower-level VM and bytecode debugging:
nix develop -c cargo run -p php_vm_cli --bin php-vm -- run path/to/file.phpPrefer phrust-php for PHP-user compatibility checks and php-vm for
developer-only VM inspection.