Upsun User Documentation


Back to home

On this page

Sign up

Get your free trial by clicking the link below.

Get your Upsun free trial

Swoole is a PHP extension that extends PHP core with a coroutine based asynchronous network application framework designed for building large scale concurrent systems.

Unlike PHP-FPMโ€™s stateless operating, Swoole relies on establishing persistent connections with every user, sending and receiving data in real-time.

Swoole and Open Swoole are two forked libraries pursuing that goal.

For other versions of PHP, you can install both extensions manually by following the instructions on this page.
You need:

  • PHP 7.3+ for Swoole
  • PHP 7.4.0+ for Open Swoole
  • The Swoole installation script.

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
        type: 'php:<VERSION>'
            build: |
                set -e
                curl -fsS | { bash /dev/fd/3 openswoole 4.11.0 ; } 3<&0                

Use Anchor to this heading

Override the default web server with a custom start command. Octane should listen on a TCP socket.

        type: 'php:8.3'
                socket_family: tcp
                protocol: http
                start: php PATH_TO_SWOOLE_START_COMMAND --port=$PORT
                    passthru: true
                    scripts: false
                    allow: false

Is this page helpful?