php-earth / swoole-engine
Event-driven engine for running PHP with Swoole extension.
Installs: 761
Dependents: 0
Suggesters: 0
Security: 0
Stars: 37
Watchers: 10
Forks: 5
Open Issues: 0
Requires
- php: >=7.1
- ext-swoole: *
- symfony/console: ^3.3|^4.0
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is not auto-updated.
Last update: 2020-07-14 20:52:57 UTC
README
Event-driven PHP engine for running PHP Applications with Swoole extension.
Installation
Before using this library, you'll need Swoole extension
Installing using PECL:
pecl install swoole
Add extension=swoole
(or extension=swoole.so
for PHP < 7.2) to your php.ini
file for PHP CLI sapi:
echo "extension=swoole" | sudo tee --append `php -r 'echo php_ini_loaded_file();'`
Check if Swoole extension is loaded
php --ri swoole
You should see something like
swoole swoole support => enabled Version => 2.0.10 Author => tianfeng.han[email: mikan.tenny@gmail.com] epoll => enabled eventfd => enabled timerfd => enabled signalfd => enabled cpu affinity => enabled spinlock => enabled rwlock => enabled async http/websocket client => enabled Linux Native AIO => enabled pcre => enabled mutex_timedlock => enabled pthread_barrier => enabled futex => enabled Directive => Local Value => Master Value swoole.aio_thread_num => 2 => 2 swoole.display_errors => On => On swoole.use_namespace => On => On swoole.fast_serialize => Off => Off swoole.unixsock_buffer_size => 8388608 => 8388608
Then proceed and install Swoole Engine library in your project with Composer:
composer require php-earth/swoole-engine
Usage
Currently supported frameworks:
- Symfony:
vendor/bin/swoole [--env=dev|prod|...] [--host=IP] [--no-debug]
Documentation
For more information, read the documentation:
License
Contributions are most welcome. This repository is released under the MIT license.