Zap
Documentation / Getting started

Installation

Set up the requirements, install Composer dependencies, and configure your environment to run a Zap application.

Requirements

  • PHP 8.0 or later.
  • Composer.
  • A web server with URL rewriting enabled for Apache deployments.
  • The PHP extensions required by your configured database and application features.

Install dependencies

From the project directory, install the packages declared by the framework:

composer install

For a Windows PowerShell setup, use Copy-Item in the next step to create your local environment file. Keep the generated vendor/ directory out of version control.

Configure the environment

Copy the example configuration, then update the values for your machine:

Copy-Item .env.example .env

Generate a unique application key with Zap's CLI, then copy the generated value into APP_KEY in your local .env file:

php console generate --key
Keep .env private and do not commit it. Configure database connection values when your application uses a database.

Run locally

Start PHP's built-in development server from the project root:

php -S localhost:8000 dev-server.php

Open http://localhost:8000 in your browser.

For Apache or another web server, e.g. WAMP, open http://localhost/project-dir directory and ensure the rewrite rules are enabled.

Before deploying

  • Use a unique, strong APP_KEY and keep environment secrets outside the repository.
  • Set APP_ENV=production and serve the site over HTTPS.
  • Configure the web server to expose only the public/ directory.
  • Install production dependencies with composer install --no-dev --optimize-autoloader.
Next: learn the framework flow

See how requests move through routes, controllers, and views.

Read overview