久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='qZ2F1'></bdo><ul id='qZ2F1'></ul>

      <i id='qZ2F1'><tr id='qZ2F1'><dt id='qZ2F1'><q id='qZ2F1'><span id='qZ2F1'><b id='qZ2F1'><form id='qZ2F1'><ins id='qZ2F1'></ins><ul id='qZ2F1'></ul><sub id='qZ2F1'></sub></form><legend id='qZ2F1'></legend><bdo id='qZ2F1'><pre id='qZ2F1'><center id='qZ2F1'></center></pre></bdo></b><th id='qZ2F1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qZ2F1'><tfoot id='qZ2F1'></tfoot><dl id='qZ2F1'><fieldset id='qZ2F1'></fieldset></dl></div>

      <small id='qZ2F1'></small><noframes id='qZ2F1'>

      1. <legend id='qZ2F1'><style id='qZ2F1'><dir id='qZ2F1'><q id='qZ2F1'></q></dir></style></legend>

        <tfoot id='qZ2F1'></tfoot>
      2. 為什么在連接失敗時 PDO 會打印我的密碼?

        Why does PDO print my password when the connection fails?(為什么在連接失敗時 PDO 會打印我的密碼?)
          <bdo id='2vTMc'></bdo><ul id='2vTMc'></ul>
        • <legend id='2vTMc'><style id='2vTMc'><dir id='2vTMc'><q id='2vTMc'></q></dir></style></legend>

          <i id='2vTMc'><tr id='2vTMc'><dt id='2vTMc'><q id='2vTMc'><span id='2vTMc'><b id='2vTMc'><form id='2vTMc'><ins id='2vTMc'></ins><ul id='2vTMc'></ul><sub id='2vTMc'></sub></form><legend id='2vTMc'></legend><bdo id='2vTMc'><pre id='2vTMc'><center id='2vTMc'></center></pre></bdo></b><th id='2vTMc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2vTMc'><tfoot id='2vTMc'></tfoot><dl id='2vTMc'><fieldset id='2vTMc'></fieldset></dl></div>
            • <tfoot id='2vTMc'></tfoot>

                    <tbody id='2vTMc'></tbody>

                  <small id='2vTMc'></small><noframes id='2vTMc'>

                  本文介紹了為什么在連接失敗時 PDO 會打印我的密碼?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個簡單的網(wǎng)站,我在其中使用 PDO 建立到 MySQL 服務器的連接.

                  I have a simple website where I establish a connection to a MySQL server using PDO.

                  $dbh = new PDO('mysql:host=localhost;dbname=DB;port=3306',
                                 'USER',
                                 'SECRET', 
                                 array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
                  

                  我的網(wǎng)站上有一些流量并且達到了服務器的連接限制,網(wǎng)站拋出了這個錯誤,其中包含我的普通密碼!

                  I had some traffic on my site and the server's connection limit was reached, and the website throws this error, with my plain password in it!

                  致命錯誤:未捕獲的異常帶有消息的PDOException"'SQLSTATE[08004] [1040] 太多連接'在/home/domain/html/index.php:xxx堆棧跟蹤:#0/home/domain/html/index.php(64):PDO->__construct('mysql:host=loca...','用戶'、'秘密'、數(shù)組)#1{main} 投入/home/domain/html/index.php 上第 64 行

                  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08004] [1040] Too many connections' in /home/domain/html/index.php:xxx Stack trace: #0 /home/domain/html/index.php(64): PDO->__construct('mysql:host=loca...', 'USER', 'SECRET', Array) #1 {main} thrown in /home/domain/html/index.php on line 64

                  具有諷刺意味的是,我出于安全原因切換到 PDO,所以這真的讓我感到震驚,因為在大多數(shù)使用簡單 HTTP 泛洪的網(wǎng)站上,您可以很容易地引發(fā)這個確切的錯誤.

                  Ironically I switched to PDO for security reasons, so this really shocked me, because this exact error is something you can provoke very easily on most sites using simple HTTP flooding.

                  我現(xiàn)在已經將我的連接包裹在一個 try/catch 塊中,但我仍然認為這是災難性的!

                  I have now wrapped my connection in a try/catch block, but still I think this is catastrophic!

                  我是 PDO 的新手,所以我的問題是:我必須做什么才能確保安全?如何以安全的方式建立連接?是否還有其他已知的安全漏洞需要我注意?

                  I am new to PDO and so my question is: what do I have to do to consider to be safe? How do I establish a connection in a secure way? Are there other known security holes like this one that I have to be aware of?

                  推薦答案

                  無論如何,您都應該在 PHP.ini 中設置 display_errors = off 以避免此問題.除了 PDO 之外,顯示此類詳細信息的錯誤還來自許多地方.

                  You should have display_errors = off in your PHP.ini anyway to avoid this problem. Errors that reveal details like these come from many places, in addition to PDO.

                  是的,您也應該將它放在 try/catch 塊中.

                  Yes, you should also have it in a try/catch block.

                  您也可以$pdo->setAttribute(PDO::ERRMODE_SILENT),但是您需要手動檢查錯誤代碼而不是使用 try/catch 塊.請參閱http://php.net/manual/en/pdo.setattribute.php 獲取更多錯誤常量.

                  You can also $pdo->setAttribute(PDO::ERRMODE_SILENT), but then you need to be checking the error codes manually rather than using a try/catch block. See http://php.net/manual/en/pdo.setattribute.php for more error constants.

                  這篇關于為什么在連接失敗時 PDO 會打印我的密碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                    <i id='A0GhP'><tr id='A0GhP'><dt id='A0GhP'><q id='A0GhP'><span id='A0GhP'><b id='A0GhP'><form id='A0GhP'><ins id='A0GhP'></ins><ul id='A0GhP'></ul><sub id='A0GhP'></sub></form><legend id='A0GhP'></legend><bdo id='A0GhP'><pre id='A0GhP'><center id='A0GhP'></center></pre></bdo></b><th id='A0GhP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='A0GhP'><tfoot id='A0GhP'></tfoot><dl id='A0GhP'><fieldset id='A0GhP'></fieldset></dl></div>
                      <bdo id='A0GhP'></bdo><ul id='A0GhP'></ul>

                          <small id='A0GhP'></small><noframes id='A0GhP'>

                              <tbody id='A0GhP'></tbody>
                            <legend id='A0GhP'><style id='A0GhP'><dir id='A0GhP'><q id='A0GhP'></q></dir></style></legend>
                            <tfoot id='A0GhP'></tfoot>
                          • 主站蜘蛛池模板: 性色av蜜臀av浪潮av老女人 | 一级黄视频 | 一本到av| 欧美一级黄色大片 | 日韩精品久久久久久 | 久久免费福利视频 | 日韩三级一区 | 国产伦精品一区二区三区视频黑人 | 欧美三级在线视频 | 中文字幕亚洲精品 | 亚洲 欧美 另类 综合 偷拍 | 91久久精品视频 | 一级黄色大片 | 一区二区欧美日韩 | 丝袜美腿一区二区三区 | 一区免费视频 | 伊人黄色 | 狠狠插狠狠操 | 人人爽人人澡 | 午夜大片| jlzzjlzz欧美大全| 国产免费黄色片 | 精品一区二区免费视频 | 国产日韩视频 | 女教师合集乱500篇小说 | 国产黄色免费看 | 成人做受黄大片 | 免费黄色一级视频 | 久草福利资源 | 欧美黑粗大 | 超碰97av | 色天使在线视频 | 中文字幕一区二区在线播放 | 日本欧美视频 | 三级黄色片 | 国产日韩精品视频 | 中文字幕超清在线观看 | 亚洲精品91天天久久人人 | 国产成人精品一区二区三区在线 | 日韩女优在线观看 | 亚洲天堂久久 |