-
Notifications
You must be signed in to change notification settings - Fork 389
4. 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.