Installation
This package relies on Swoole extension. Make sure you've installed Swoole before using this package. Using this command to install it quickly:
pecl install swoole
After installing the extension, you will need to edit php.ini
and add extension=swoole.so
line before using it.
php -i | grep php.ini # check the php.ini file location
sudo echo "extension=swoole.so" >> php.ini # append "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 supports 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:
It supports Package Auto Discovery. If your Laravel version is above 5.5, please skip this step.
If using Laravel, add the Service Provider to the providers
array in config/app.php
:
[
'providers' => [
SwooleTW\Http\LaravelServiceProvider::class,
],
]
If using Lumen, append the following line to bootstrap/app.php
:
$app->register(SwooleTW\Http\LumenServiceProvider::class);
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于