Turn off deprecated errors in PHP 5.3

前端 未结 9 1464
天涯浪人
天涯浪人 2020-12-02 11:32

My server is running PHP 5.3 and my WordPress install is spitting these errors out on me, causing my session_start() to break.

Deprecated: Assigning the re         


        
9条回答
  •  情歌与酒
    2020-12-02 12:16

    I just faced a similar problem where a SEO plugin issued a big number of warnings making my blog disk use exceed the plan limit.

    I found out that you must include the error_reporting command after the wp-settings.php require in the wp-config.php file:

       require_once( ABSPATH .'wp-settings.php' );
       error_reporting( E_ALL ^ ( E_NOTICE | E_WARNING | E_DEPRECATED ) );
    

    by doing this no more warnings, notices nor deprecated lines are appended to your error log file!

    Tested on WordPress 3.8 but I guess it works for every installation.

提交回复
热议问题