Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

4. Installation

Albert Chen edited this page May 4, 2018 · 11 revisions

Installation

This package relies on Swoole extension. Make sure you've installed Swoole before you use this package. Using this command to install it quickly:

pecl install swoole

After installing the swoole extension to the PHP extensions directory, you will need to edit php.ini and add an extension=swoole.so line before you can use the swoole extension.

php -i | grep php.ini                      # check the php.ini file location
sudo echo "extension=swoole.so" > php.ini  # add the extension=swoole.so to the end of php.ini
php -m | grep swoole                       # check if the swoole extension has been enabled

Visit the official website for more information.

Notice: Swoole currently only supoorts Linux and OSX. Windows servers are not able to use Swoole yet.

Require this package with composer:

$ composer require swooletw/laravel-swoole

Then, add the service provider:

If you are using Laravel, add the service provider to the providers array in config/app.php:

[
    'providers' => [
        SwooleTW\Http\LaravelServiceProvider::class,
    ],
]

If you are using Lumen, append the following code to bootstrap/app.php:

$app->register(SwooleTW\Http\LumenServiceProvider::class);

It supports package auto discovery. If you're running Laravel 5.5, you can skip this step.

Clone this wiki locally