<span id="pfnzv"></span>
      <form id="pfnzv"><span id="pfnzv"></span></form><address id="pfnzv"><span id="pfnzv"><nobr id="pfnzv"></nobr></span></address>
      <form id="pfnzv"><dfn id="pfnzv"><listing id="pfnzv"></listing></dfn></form>

        <sub id="pfnzv"><address id="pfnzv"></address></sub>
          <address id="pfnzv"><form id="pfnzv"><listing id="pfnzv"></listing></form></address>
          <address id="pfnzv"><address id="pfnzv"><nobr id="pfnzv"></nobr></address></address>

            <address id="pfnzv"></address>
            0712-2888027 189-8648-0214
            微信公眾號

            孝感風信網絡科技有限公司微信公眾號

            當前位置:主頁 > 技術支持 > PHP > 升級至Laravel 5.7報錯setTrustedProxies() must be of the type integer的處理

            升級至Laravel 5.7報錯setTrustedProxies() must be of the type integer的處理

            時間:2024-08-23來源:風信官網 點擊: 2356次
            報錯信息如下:
             
            Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Argument 2 passed to Symfony\Component\HttpFoundation\Request::
            setTrustedProxies() must be of the type integer, array given, called in D:\phpStudy\Laravel5.5\vendor\fideloper\proxy\src\TrustProxies.php on line 54"

            升級至Laravel 5.7報錯setTrustedProxies() must be of the type integer的處理
             
            查閱文檔發現是由于Symfony HttpFoundation 的可信任代理功能發生了根本性的改變,需要調整中是間件。
             
            打開 App\Http\Middleware\TrustProxies
             
            將代碼:
             
            protected $headers = [
                    Request::HEADER_FORWARDED => 'FORWARDED',
                    Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
                    Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
                    Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
                    Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
                ];
             
            修改為:
             
            protected $headers = Request::HEADER_X_FORWARDED_ALL;
             
            再次測試正常。
            熱門關鍵詞: 升級 Laravel 5.7 setTrustedProxies()
            欄目列表
            推薦內容
            熱點內容
            展開
            国产精久久久久无码AV动漫|最新亚洲精品国偷自产在线|2021亚洲色中文字幕在线|最新无码av中文字专区 情欲美妇紧致敏感 国产免费AⅤ片在线播放 人妻爽爽免费在线视频 51精品国产人成在线观看 色偷偷av一区二区三区
            <span id="pfnzv"></span>
                <form id="pfnzv"><span id="pfnzv"></span></form><address id="pfnzv"><span id="pfnzv"><nobr id="pfnzv"></nobr></span></address>
                <form id="pfnzv"><dfn id="pfnzv"><listing id="pfnzv"></listing></dfn></form>

                  <sub id="pfnzv"><address id="pfnzv"></address></sub>
                    <address id="pfnzv"><form id="pfnzv"><listing id="pfnzv"></listing></form></address>
                    <address id="pfnzv"><address id="pfnzv"><nobr id="pfnzv"></nobr></address></address>

                      <address id="pfnzv"></address>