<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                >[danger] **注意**:不推薦使用原生swoole加速框架,一般使用組件進行加速。 >[danger] 加速 laravel 6框架 * **未加速**,訪問 index.php 為 <span style="color:red;"> **228ms** </span>: * 訪問地址:http://127.0.0.1/swoole_2010/laravel6/public/index.php ![](https://img.kancloud.cn/70/b8/70b8e8b7d41d5a5da5f0af6985d01c6b_1686x992.png) * **使用swoole加速** 1. 在 public 入口目錄下新建 <span style="color:red;"> **swoole.php** </span> 用于測試,并寫入如下代碼: ~~~ <?php // 記錄laravel 開始時間 define('LARAVEL_START', microtime(true)); // 加載composer 命名規范 require __DIR__.'/../vendor/autoload.php'; // 加載初始化laravel app應用程序 $app = require_once __DIR__.'/../bootstrap/app.php'; // 得到laravel 核心處理對象 $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); // 實例化swoole服務 $http = new Swoole\Http\Server("0.0.0.0", 9501); // 注冊 請求 request事件 $http->on("request", function ($request_swoole, $response_swoole) use ($kernel) { // 做一個請求處理 得到一個訪問對象 $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); // 設置header頭 // $response_swoole->header("Content-Type", "text/plain"); // 關閉中間件 $response_swoole->end($response->send()); // 停止中間件 $kernel->terminate($request, $response); }); // 啟動swoole服務 $http->start(); ~~~ 2. 在終端運行該 <span style="color:red;"> **swoole.php** </span> 進行監聽; ``` php laravel6/public/swoole.php ``` ![](https://img.kancloud.cn/8d/99/8d9912eaf95899820574d6e942d388ba_607x131.png) 3. 在瀏覽器直接訪問IP地址,加上對應監聽的端口號訪問,使用swoole加速后,訪問時間為 <span style="color:red;"> **10ms** </span>: ``` http://192.168.108.130:9501/ ``` ![](https://img.kancloud.cn/c3/42/c3428ce7927a5060c3460ad5f90b65cd_1732x1198.png) * **存在的問題**: 1. 在 index.php 地址后隨便加入 其他字符串; > <span style="color:red;"> 本地 </span>:加入 test 直接報錯 404 ![](https://img.kancloud.cn/ad/9d/ad9d11b35cc79425873555f8b1497399_1333x907.png) > <span style="color:red;"> 服務器 </span>:加入 test 不報錯,直接還在首頁 ![](https://img.kancloud.cn/7a/91/7a91d5477c8a8fa70301b604c7ec00ed_1334x797.png) >[danger] 加速 tp 6框架
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看