User Documentation

Laravel Octane

Back to home

On this page

Sign up for Upsun

Get your free trial by clicking the link below.

Get your Upsun free trial

Laravel Octane aims at improving the performance of Laravel applications by serving them using high-powered application servers, including Swoole, Open Swoole, and RoadRunner.

Install Anchor to this heading

Install the PHP extension for Swoole or Open Swoole during the build.

Take advantage of an installation script. You need to pass 2 parameters:

  • Which Swoole project to use: openswoole or swoole
  • Which version to install
    build: |
        set -e
        curl -fsS | { bash /dev/fd/3 openswoole 4.11.0 ; } 3<&0        

Use Anchor to this heading

Require Laravel Octane using Composer.

composer require laravel/octane

Then make sure to clear the cache on all relevant environments.

php artisan optimize:clear

Override the default web server with a custom start command. Octane should listen on a TCP socket.
        socket_family: tcp
        protocol: http
        start: php artisan octane:start --server=swoole --host= --port=$PORT
            passthru: true
            scripts: false
            allow: false

Is this page helpful?