久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      關于升級php7后的報錯處理

      由于php7的出現(xiàn)帶來大幅的性能提升,想體驗下新版本帶來的特性,因此做了升級。

      發(fā)現(xiàn)在網(wǎng)站中請求接口時發(fā)生錯誤,排查后把解決方法記錄下來

      升級php后站點報錯,提示如下:

      Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘a(chǎn)lways_populate_raw_post_data‘ to ‘-1‘ in php.ini and use the php://input stream instead. in Unknown on line 0 Warning: Cannot modify header information - headers already sent in Unknown on line 0

      通過查詢php官網(wǎng)后得知,在php5.6.X以后版本某些特性已經(jīng)被廢棄,詳情查看:

      http://php.net/manual/zh/migration56.deprecated.php

      原因是:

      $HTTP_RAW_POST_DATA 和 always_populate_raw_post_data

      使用 always_populate_raw_post_data 會導致在填充 $HTTP_RAW_POST_DATA 時產(chǎn)生 E_DEPRECATED 錯誤。

      請使用 php://input 替代 $HTTP_RAW_POST_DATA, 因為它可能在后續(xù)的 PHP 版本中被移除。

      設置 always_populate_raw_post_data 為 -1 (這樣會強制 $HTTP_RAW_POST_DATA 未定義,所以也不回導致 E_DEPRECATED 的錯誤) 來體驗新的行為。

      修復方法:

      1、修改php的配置文件,找到php.ini。把 always_populate_raw_post_data 開啟,并設置為 -1 。

      always_populate_raw_post_data = -1

      2、如果項目中有用到$HTTP_RAW_POST_DATA的更改為:

      原來是 $info = $HTTP_RAW_POST_DATA;

      更改為 $info = file_get_contents(‘php://input‘);

      推薦:《PHP7

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號