Revision: Thu, 25 Apr 2024 11:07:00 GMT

Getting started — Installation

Spiral provides a convenient application installer that allows developers to easily install and configure the framework and any desired packages through a command line interface. This helps streamline the process of getting started with Spiral and simplifies the setup of the development environment.

It can be very useful for installing all required config files, environment variables, and bootloaders for the desired packages and components. The installer allows developers to easily install a variety of packages and components, including:

Having these packages and components readily available and properly configured through the installer can save developers time and effort in setting up their development environment and getting their projects up and running.

Server Requirements

Make sure that your server is configured with the following PHP version and extensions:

  • PHP 8.1+, 64bit
  • mb-string extension (spiral is UTF-8 centric framework)
  • socket extension
  • curl extension
  • zip extension

Installation

Installation process with the installer is very straightforward and easy to use. You can use the following command to create a new project:

composer create-project spiral/app my-app

And you will see the following output:

Creating a "spiral/app" project at "./my-app"
Installing spiral/app (1.1.1)
- Installing spiral/app (1.1.1): Extracting archive
Created project in /var/www/my-app
> Installer\Installer::install
Which application preset do you want to install?
[1] Web
[2] Cli
[3] gRPC
Make your selection (1):

Note
When something went wrong during installation process, you can always restart it by running composer install command.

Once the application is installed, README.md file will be generated in the root directory of the project with the instructions on how to start the application server and how to run the application.

Warning
RoadRunner application server will be downloaded automatically. php-curl and php-zip required.

Running the Server

To start application server execute:

Use the following command to run RoadRunner server on Linux

./rr serve

Warning
Make sure that rr binary is executable.

By default, the application will be available on http://localhost:8080.

See more
Read more about application server in the Getting started — Application Server section.


What's Next?

Now, dive deeper into the fundamentals by reading some articles: