Chapter 2: Installation & Setup
Download HolyPHP
There are several ways to get HolyPHP:
Option 1: Download Installer (Easiest)
From the official website:
- Windows (x64):
HolyPHP-1.0.2-x64-setup.exe- No admin needed - Linux (Debian/Ubuntu): Current amd64 package from GitHub Releases
Option 2: Build from Source
If you want to build it yourself, you'll need a C11 compiler (gcc/clang/MSVC) and GNU ld.
git clone https://github.com/Elifoxcoder/holyphp
cd holyphp
bash scripts/build.sh
./hphp.exe version # Windows / MinGW
./hphp version # Linux
On Windows the setup installs the compiler for your user and can add it to your user PATH.
Open a new terminal after setup. On Debian or Ubuntu, install the downloaded package with
sudo apt install ./holyphp_<version>_amd64.deb.
Verify Installation
After installation, open a terminal/command prompt and check:
hphp version
For the 1.0.2 release, the version command reports:
HolyPHP 1.0.2
Understanding the hphp Command
The hphp command is your main tool. Here are the most common commands:
| Command | Description |
|---|---|
hphp run file.hphp | Compile and run a program immediately |
hphp build file.hphp -o app | Build a standalone executable |
hphp check file.hphp | Check types and borrows without running |
hphp emit file.hphp | Show internal representation |
hphp pkg | Package manager |
hphp version | Show version info |
Build requirements
The compiler is separate from the C compiler used as a backend. To compile or run a source
file, install GCC or another supported C compiler and linker, then confirm gcc
is available in your terminal PATH. The compiler itself can print its version without GCC.
Environment Variables (Optional)
| Variable | Effect |
|---|---|
HPHP_VERBOSE=1 | Show backend commands during compilation |
HPHP_KEEP_BIN=1 | Keep the temporary executable when using hphp run |
Code Editors
HolyPHP has a VS Code extension for syntax highlighting and live diagnostics:
code --install-extension extension/hphp/holyphp-0.1.0.vsix
It provides syntax highlighting, completions for all 305 builtins, hover signatures, and live hphp check diagnostics.
.hphp extension.
hphp version. Then check whether a C compiler is available with gcc --version. Write down which command works and what version it reports.Show a hint
Take one small step at a time. Follow the instructions above, write down the result you expect, and compare it with what your terminal or Playground shows. If a command fails, check the filename and that you opened a new terminal after installation.