easyswoole下载安装

PHP / 118人浏览 / 0人评论

EasySwoole 是一款基于 Swoole Server 开发的常驻内存型的分布式 PHP 框架,专为 API 而生,摆脱传统 PHP 运行模式在进程唤起和文件加载上带来的性能损失。 EasySwoole 高度封装了 Swoole Server 而依旧维持 Swoole Server 原有特性,支持同时混合监听 HTTP、自定义 TCP、UDP 协议,让开发者以最低的学习成本和精力编写出多进程、可异步、高可用的应用服务。

EasySwoole简介

EasySwoole 是一款基于 Swoole Server 开发的常驻内存型的分布式 PHP 框架,专为 API 而生,摆脱传统 PHP 运行模式在进程唤起和文件加载上带来的性能损失。 EasySwoole 高度封装了 Swoole Server 而依旧维持 Swoole Server 原有特性,支持同时混合监听 HTTP、自定义 TCP、UDP 协议,让开发者以最低的学习成本和精力编写出多进程、可异步、高可用的应用服务。

下载EasySwoole

composer require easyswoole/easyswoole=3.5.x
./composer.json has been created
Running composer update easyswoole/easyswoole
Loading composer repositories with package information
Updating dependencies
Lock file operations: 59 installs, 0 updates, 0 removals
  - Locking doctrine/instantiator (1.4.1)
  - Locking doctrine/lexer (1.2.3)
  - Locking dragonmantank/cron-expression (v2.3.1)
  - Locking easyswoole/annotation (2.0.3)
  - Locking easyswoole/bridge (1.0.3)
  - Locking easyswoole/command (1.1.7)
  - Locking easyswoole/component (2.3.2)
  - Locking easyswoole/config (1.0.7)
  - Locking easyswoole/crontab (1.0.1)
  - Locking easyswoole/doctrine-annotations (1.0.1)
  - Locking easyswoole/easyswoole (3.5.1)
  - Locking easyswoole/http (2.0.4)
  - Locking easyswoole/http-annotation (2.2.1)
  - Locking easyswoole/log (1.1.1)
  - Locking easyswoole/parsedown (1.0.2)
  - Locking easyswoole/phpunit (1.1.0)
  - Locking easyswoole/session (3.0.1)
  - Locking easyswoole/socket (1.1.14)
  - Locking easyswoole/spl (1.4.1)
  - Locking easyswoole/task (1.1.2)
  - Locking easyswoole/trigger (1.0.0)
  - Locking easyswoole/utility (1.3.2)
  - Locking easyswoole/validate (2.1.3)
  - Locking myclabs/deep-copy (1.11.0)
  - Locking nikic/fast-route (v1.3.0)
  - Locking nikic/php-parser (v4.13.2)
  - Locking opis/closure (3.6.3)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.2.1)
  - Locking phpdocumentor/reflection-common (2.2.0)
  - Locking phpdocumentor/reflection-docblock (5.3.0)
  - Locking phpdocumentor/type-resolver (1.6.1)
  - Locking phpspec/prophecy (v1.15.0)
  - Locking phpunit/php-code-coverage (9.2.15)
  - Locking phpunit/php-file-iterator (3.0.6)
  - Locking phpunit/php-invoker (3.1.1)
  - Locking phpunit/php-text-template (2.0.4)
  - Locking phpunit/php-timer (5.0.3)
  - Locking phpunit/phpunit (9.5.18)
  - Locking psr/http-message (1.0.1)
  - Locking sebastian/cli-parser (1.0.1)
  - Locking sebastian/code-unit (1.0.8)
  - Locking sebastian/code-unit-reverse-lookup (2.0.3)
  - Locking sebastian/comparator (4.0.6)
  - Locking sebastian/complexity (2.0.2)
  - Locking sebastian/diff (4.0.4)
  - Locking sebastian/environment (5.1.4)
  - Locking sebastian/exporter (4.0.4)
  - Locking sebastian/global-state (5.0.5)
  - Locking sebastian/lines-of-code (1.0.3)
  - Locking sebastian/object-enumerator (4.0.4)
  - Locking sebastian/object-reflector (2.0.4)
  - Locking sebastian/recursion-context (4.0.4)
  - Locking sebastian/resource-operations (3.0.3)
  - Locking sebastian/type (2.3.4)
  - Locking sebastian/version (3.0.2)
  - Locking symfony/polyfill-ctype (v1.25.0)
  - Locking theseer/tokenizer (1.2.1)
  - Locking webmozart/assert (1.10.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 59 installs, 0 updates, 0 removals
  - Downloading dragonmantank/cron-expression (v2.3.1)
  - Downloading doctrine/lexer (1.2.3)
  - Downloading easyswoole/doctrine-annotations (1.0.1)
  - Downloading easyswoole/utility (1.3.2)
  - Downloading easyswoole/log (1.1.1)
  - Downloading easyswoole/trigger (1.0.0)
  - Downloading opis/closure (3.6.3)
  - Downloading easyswoole/spl (1.4.1)
  - Downloading easyswoole/component (2.3.2)
  - Downloading easyswoole/task (1.1.2)
  - Downloading easyswoole/socket (1.1.14)
  - Downloading sebastian/version (3.0.2)
  - Downloading sebastian/type (2.3.4)
  - Downloading sebastian/resource-operations (3.0.3)
  - Downloading sebastian/recursion-context (4.0.4)
  - Downloading sebastian/object-reflector (2.0.4)
  - Downloading sebastian/object-enumerator (4.0.4)
  - Downloading sebastian/global-state (5.0.5)
  - Downloading sebastian/exporter (4.0.4)
  - Downloading sebastian/environment (5.1.4)
  - Downloading sebastian/diff (4.0.4)
  - Downloading sebastian/comparator (4.0.6)
  - Downloading sebastian/code-unit (1.0.8)
  - Downloading sebastian/cli-parser (1.0.1)
  - Downloading phpunit/php-timer (5.0.3)
  - Downloading phpunit/php-text-template (2.0.4)
  - Downloading phpunit/php-invoker (3.1.1)
  - Downloading phpunit/php-file-iterator (3.0.6)
  - Downloading theseer/tokenizer (1.2.1)
  - Downloading nikic/php-parser (v4.13.2)
  - Downloading sebastian/lines-of-code (1.0.3)
  - Downloading sebastian/complexity (2.0.2)
  - Downloading sebastian/code-unit-reverse-lookup (2.0.3)
  - Downloading phpunit/php-code-coverage (9.2.15)
  - Downloading symfony/polyfill-ctype (v1.25.0)
  - Downloading webmozart/assert (1.10.0)
  - Downloading phpdocumentor/reflection-common (2.2.0)
  - Downloading phpdocumentor/type-resolver (1.6.1)
  - Downloading phpdocumentor/reflection-docblock (5.3.0)
  - Downloading doctrine/instantiator (1.4.1)
  - Downloading phpspec/prophecy (v1.15.0)
  - Downloading phar-io/version (3.2.1)
  - Downloading phar-io/manifest (2.0.3)
  - Downloading myclabs/deep-copy (1.11.0)
  - Downloading phpunit/phpunit (9.5.18)
  - Downloading easyswoole/command (1.1.7)
  - Downloading easyswoole/phpunit (1.1.0)
  - Downloading psr/http-message (1.0.1)
  - Downloading easyswoole/validate (2.1.3)
  - Downloading easyswoole/parsedown (1.0.2)
  - Downloading nikic/fast-route (v1.3.0)
  - Downloading easyswoole/session (3.0.1)
  - Downloading easyswoole/http (2.0.4)
  - Downloading easyswoole/annotation (2.0.3)
  - Downloading easyswoole/http-annotation (2.2.1)
  - Downloading easyswoole/crontab (1.0.1)
  - Downloading easyswoole/config (1.0.7)
  - Downloading easyswoole/bridge (1.0.3)
  - Downloading easyswoole/easyswoole (3.5.1)
  - Installing dragonmantank/cron-expression (v2.3.1): Extracting archive
  - Installing doctrine/lexer (1.2.3): Extracting archive
  - Installing easyswoole/doctrine-annotations (1.0.1): Extracting archive
  - Installing easyswoole/utility (1.3.2): Extracting archive
  - Installing easyswoole/log (1.1.1): Extracting archive
  - Installing easyswoole/trigger (1.0.0): Extracting archive
  - Installing opis/closure (3.6.3): Extracting archive
  - Installing easyswoole/spl (1.4.1): Extracting archive
  - Installing easyswoole/component (2.3.2): Extracting archive
  - Installing easyswoole/task (1.1.2): Extracting archive
  - Installing easyswoole/socket (1.1.14): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (2.3.4): Extracting archive
  - Installing sebastian/resource-operations (3.0.3): Extracting archive
  - Installing sebastian/recursion-context (4.0.4): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.5): Extracting archive
  - Installing sebastian/exporter (4.0.4): Extracting archive
  - Installing sebastian/environment (5.1.4): Extracting archive
  - Installing sebastian/diff (4.0.4): Extracting archive
  - Installing sebastian/comparator (4.0.6): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.1): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing nikic/php-parser (v4.13.2): Extracting archive
  - Installing sebastian/lines-of-code (1.0.3): Extracting archive
  - Installing sebastian/complexity (2.0.2): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.15): Extracting archive
  - Installing symfony/polyfill-ctype (v1.25.0): Extracting archive
  - Installing webmozart/assert (1.10.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing phpdocumentor/type-resolver (1.6.1): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
  - Installing doctrine/instantiator (1.4.1): Extracting archive
  - Installing phpspec/prophecy (v1.15.0): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.11.0): Extracting archive
  - Installing phpunit/phpunit (9.5.18): Extracting archive
  - Installing easyswoole/command (1.1.7): Extracting archive
  - Installing easyswoole/phpunit (1.1.0): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing easyswoole/validate (2.1.3): Extracting archive
  - Installing easyswoole/parsedown (1.0.2): Extracting archive
  - Installing nikic/fast-route (v1.3.0): Extracting archive
  - Installing easyswoole/session (3.0.1): Extracting archive
  - Installing easyswoole/http (2.0.4): Extracting archive
  - Installing easyswoole/annotation (2.0.3): Extracting archive
  - Installing easyswoole/http-annotation (2.2.1): Extracting archive
  - Installing easyswoole/crontab (1.0.1): Extracting archive
  - Installing easyswoole/config (1.0.7): Extracting archive
  - Installing easyswoole/bridge (1.0.3): Extracting archive
  - Installing easyswoole/easyswoole (3.5.1): Extracting archive
5 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

EasySwoole安装

php vendor/bin/easyswoole install

EasySwoole配置文件修改端口

'PORT' => 9601,

运行EasySwoole

php easyswoole server start

EasySwoole Nginx代理访问

upstream chprovider_user {
    server chprovider-user:9601;
}

hosts绑定域名

shop_provider_user.top
server {
    # 监听端口
    listen 80; 
    # 绑定的域名,填写您的域名
    server_name shop_provider_user.top;

    location / {
        # 将客户端的 Host 和 IP 信息一并转发到对应节点  
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        
        # 转发Cookie,设置 SameSite
        proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";
        
        # 执行代理访问真实服务器
        proxy_pass http://chprovider_user;
    }
}

浏览器输入域名访问

shop_provider_user.top

easyswoole

转载注明:

扩展查找

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我