溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么解決strict standards php報(bào)錯(cuò)問題

發(fā)布時(shí)間:2021-12-09 10:32:21 來(lái)源:億速云 閱讀:166 作者:小新 欄目:編程語(yǔ)言

這篇文章給大家分享的是有關(guān)怎么解決strict standards php報(bào)錯(cuò)問題的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來(lái)看看吧。

strict standards php報(bào)錯(cuò)的解決辦法:1、在父類之后定義繼承類;2、在“setup-config.php”文件中添加“error_reporting( ~(E_STRICT | E_NOTICE));”。

怎么解決strict standards php報(bào)錯(cuò)問題

本文操作環(huán)境:Windows7系統(tǒng),PHP5.3.3版,Dell G3電腦。

如何解決strict standards php報(bào)錯(cuò)問題?

PHP中Strict Standards錯(cuò)誤解決方法

在PHP5.3.3 中安裝wordpress 3.0.1 ,在安裝時(shí)出現(xiàn)錯(cuò)誤:

Strict Standards: PHP Strict Standards: Declaration of Walker.....的解決辦法:

出現(xiàn)錯(cuò)誤提示:

Strict Standards: PHP Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() in E:\Webroot\wordpress\wp-includes\classes.php on line 1199 PHP Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with that of Walker::end_lvl() in E:\Webroot\wordpress\wp-includes\classes.php on line 1199 PHP Strict ........

錯(cuò)誤原因:

這是由于 php 5.3版本后。要求繼承類必須在父類之后定義。否則就會(huì)出現(xiàn)Strict Standards: PHP Strict Standards: Declaration of .... should be compatible with that of .... 的錯(cuò)誤提示。也就是說(shuō)必須父類在前,繼承類在后。

錯(cuò)誤參考頁(yè)面。

bugs點(diǎn)php點(diǎn)net/bug.php?id=46851 (不能發(fā)表帶鏈接的網(wǎng)址) 上面清楚地解釋了出現(xiàn)此類錯(cuò)誤的具體原因。

解決辦法:

在wordpress3.0.1 文件中,找到 wp-admin\setup-config.php 文件。

在require_once('../wp-includes/compat.php'); 上面添加一句:

error_reporting( ~(E_STRICT | E_NOTICE));

問題解決。

這句話的意思是錯(cuò)誤報(bào)告設(shè)置:顯示所有錯(cuò)誤,但是除了嚴(yán)格錯(cuò)檢查或者錯(cuò)誤報(bào)告。也就是說(shuō)PHP5.3.3 不執(zhí)行嚴(yán)格錯(cuò)誤檢查。也不顯示錯(cuò)誤提示。跳過嚴(yán)格錯(cuò)誤檢查。


感謝各位的閱讀!關(guān)于“怎么解決strict standards php報(bào)錯(cuò)問題”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

php
AI