久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      關(guān)于升級(jí)php7后的報(bào)錯(cuò)處理

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

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

      升級(jí)php后站點(diǎn)報(bào)錯(cuò),提示如下:

      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

      通過(guò)查詢(xún)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 會(huì)導(dǎo)致在填充 $HTTP_RAW_POST_DATA 時(shí)產(chǎn)生 E_DEPRECATED 錯(cuò)誤。

      請(qǐng)使用 php://input 替代 $HTTP_RAW_POST_DATA, 因?yàn)樗赡茉诤罄m(xù)的 PHP 版本中被移除。

      設(shè)置 always_populate_raw_post_data 為 -1 (這樣會(huì)強(qiáng)制 $HTTP_RAW_POST_DATA 未定義,所以也不回導(dǎo)致 E_DEPRECATED 的錯(cuò)誤) 來(lái)體驗(yàn)新的行為。

      修復(fù)方法:

      1、修改php的配置文件,找到php.ini。把 always_populate_raw_post_data 開(kāi)啟,并設(shè)置為 -1 。

      always_populate_raw_post_data = -1

      2、如果項(xiàng)目中有用到$HTTP_RAW_POST_DATA的更改為:

      原來(lái)是 $info = $HTTP_RAW_POST_DATA;

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

      推薦:《PHP7

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