Last update: 07 May 2024

Installation

This guide will walk you through the process of creating a new application.

System requirements

Before you start, ensure the following are installed on your system:

Tip

ZAPHYR requires PHP 8.1 as the minimum version. However, we recommend using the latest stable version of PHP for the best experience.

Create application

To create a new application, open a terminal (either Command Prompt or Terminal app, depending on your OS) and run the following Composer command from the directory where you want to install your application:

composer create-project zaphyr-org/app my-app

This command installs a fresh skeleton application in a directory named my-app. Feel free to replace my-app with your desired application name.

Setup and run application

After creating the application, navigate to your application directory (my-app):

cd my-app

Set the APP_URL environment variable in the .env file at the root of your project directory:

APP_URL=http://localhost:8000

The .env file stores important configuration settings, such as environment variables. You can read more about it in the configuration section.

To start the built-in PHP web server from the root of your project, run the following command:

php -S localhost:8000 -t public

The application is now running on http://localhost:8000. You can access it in your browser by visiting the URL.

Warning

The PHP built-in web server is intended for development purposes only and is not suitable for production use.

Tip

For local development, we recommend using ddev, a Docker-based environment that simplifies setup and provides consistency across different projects.