The framework application server is based on RoadRunner but includes multiple additions specific to Spiral such as Queue, Scheduler, and GRPC integrations.
Attention, you need some basic knowledge of Golang to customize the application server.
You can download the application server directly from release page.
If your PHP includes php-cli
and php-zip
extensions you can also let spiral to download server automatically:
$ ./vendor/bin/spiral get
The spiral server is easy to run on the default :8080
port:
$ ./spiral serve -v -d
You can observe the memory consumption of your workers in realtime and other information via
$ ./spiral http:workers -i
Use similar commands
jobs:workers
andgrpc:workers
to check other dispatchers.
A lot of the sections in this documentation will explain how to extend your application capabilities by adding your own RoadRunner services, middleware, or data providers. It's essential to learn how to build a server on your own.
You are not required to learn Golang or build the application server by yourself, the default build will cover all of the framework features.
To build an application server, you need Golang 1.13+ to be installed.
Download default main.go file, we are going to use it later to register custom services. You can store this file in the root of your project or other location.
Go Modules is a Golang approach to manage your application dependencies, and it's very similar to the Composer. You can initiate a blank
go.mod
file (composer.json
analog) by running the following command in the same directory as your application.
B
$ go mod init {repository-name}
If you are planning to install custom extensions, make sure that {repository-name}
points to the repository Golang can download, for example
github.com/username/my-application
.
You can build your application server by only running:
$ go build