Download the PHP package cakedc/cakephp-roadrunner without Composer
On this page you can find all versions of the php package cakedc/cakephp-roadrunner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cakedc/cakephp-roadrunner
More information about cakedc/cakephp-roadrunner
Files in cakedc/cakephp-roadrunner
Package cakephp-roadrunner
Short Description Roadrunner bridge and worker for CakePHP
License MIT
Informations about the package cakephp-roadrunner
Roadrunner for CakePHP
RoadRunner is a high-performance PHP application server, load-balancer, and process manager written in Golang. Using Roadrunner you can replace php-fpm a long with nginx or apache.
Requirements
- CakePHP ^4.4
- PHP ^8.1
- Roadrunner ^2023.1.4
Table of Contents
- Install
- Sessions
- Static Assets
Install
Install via composer:
Unlike most CakePHP plugins you won't be needing to load the plugin in your src/Application.php
.
Installing Roadrunner
Roadrunner ships as a single go binary. Download the Roadrunner binary from the
release page and copy the file to your
filesystem, for example under /usr/local/bin/rr
or /usr/bin/rr
.
If your project uses Docker you can easily add the binary to your Dockerfile:
Be sure to check the Roadrunner documentation for up-to-date docker images.
Configuring Roadrunner
In a typical PHP application your webserver forwards *.php
requests to php-fpm, which in turn calls the CakePHP
front controller webroot/index.php
. With Roadrunner, the worker file gets called by active workers to handle
incoming requests to your application.
Create a Roadrunner worker file, or use the example worker provided:
Next we need to instruct Roadrunner to use our worker a long with a few other configs. Create a Roadrunner config file, or use the example config provided:
Start the server:
You should now be able to browse to http://localhost:8080
Sessions
If you need sessions ensure you add the following to your session config in your CakePHP config/app.php
- Add the session middleware to your
src/Application.php
middleware queue
Static Assets
You'll possibly need to configure a webserver to handle requests, serve static assets etc. Use this sample config virtualhost for nginx:
Roadrunner also supports serving static assets natively. Check the worker/rr.yaml file that ships with this project for an example.
All versions of cakephp-roadrunner with dependencies
cakephp/cakephp Version ^4.4
spiral/roadrunner Version ^2023.1.4
laminas/laminas-diactoros Version ^2.21
spiral/roadrunner-http Version ^3.0.1