strict standards php報錯的解決辦法:1、在父類之后定義繼承類;2、在“setup-config.php”文件中添加“error_reporting( ~(e_strict | e_notice));”。
本文操作環(huán)境:windows7系統(tǒng),php5.3.3版,dell g3電腦。
如何解決strict standards php報錯問題?
php中strict standards錯誤解決方法
在php5.3.3 中安裝wordpress 3.0.1 ,在安裝時出現(xiàn)錯誤:
strict standards: php strict standards: declaration of walker…..的解決辦法:
出現(xiàn)錯誤提示:
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 ……..
錯誤原因:
這是由于 php 5.3版本后。要求繼承類必須在父類之后定義。否則就會出現(xiàn)strict standards: php strict standards: declaration of …. should be compatible with that of …. 的錯誤提示。也就是說必須父類在前,繼承類在后。
錯誤參考頁面。
bugs點php點net/bug.php?id=46851 (不能發(fā)表帶鏈接的網(wǎng)址) 上面清楚地解釋了出現(xiàn)此類錯誤的具體原因。
解決辦法:
在wordpress3.0.1 文件中,找到 wp-admin\\\\setup-config.php 文件。
在require_once('../wp-includes/compat.php'); 上面添加一句:
error_reporting( ~(e_strict | e_notice));
問題解決。
這句話的意思是錯誤報告設置:顯示所有錯誤,但是除了嚴格錯檢查或者錯誤報告。也就是說php5.3.3 不執(zhí)行嚴格錯誤檢查。也不顯示錯誤提示。跳過嚴格錯誤檢查。
推薦學習:《php視頻教程》