Documentation

php2go documentation

A practical user guide: prepare a ZIP, choose an entrypoint, run allowed commands, download the artifact, and understand common compiler errors.

Fast path to the first build
  1. Pack the project into a ZIP without secrets or junk files.
  2. Make sure the entrypoint exists, usually public/index.php.
  3. Run report/check/deps before compile.
  4. Download the artifact and run the binary using README_RUN.
DEPLOY

Production deploy

The artifact is designed for a clear launch flow: unpack, set environment, start the binary, and place a reverse proxy in front. Exact paths and domains belong to your infrastructure.

Unpack Unpack the artifact into a separate release directory, not over the source project.
Environment Create production .env or server environment variables. Do not store real secrets in the source ZIP.
Run Run the binary as a normal process or through systemd/supervisor with a restart policy.
Reverse proxy For a web project, usually place Nginx/Caddy in front and proxy requests to a local port.
Logs Keep stdout/stderr and access logs: they are needed to diagnose behavior after migration.
unzip artifact.zip -d app-build
cd app-build
chmod +x app-server
APP_ENV=production APP_PORT=8080 ./app-server
Secrets are set only on your server

Do not upload production .env, private keys, or real tokens in the archive. Use config examples and set secrets when running the artifact.