WordPress.org

Ready to get started?Download WordPress

Forums

Page Restrict
Warning about 'default object from empty' (4 posts)

  1. barryha
    Member
    Posted 12 months ago #

    Works fine if I'm logged in. But the first-time visitor to my restricted page receives a PHP warning on my development web server:
    Warning: Creating default object from empty value in D:\htdocs\sdbuildingtrades\wp-content\plugins\pagerestrict\pagerestrict.php on line 76

    Where pagerestrict.php line 76 contains "$post->comment_status = 'closed';"

    The warning appeared after moving the website to a new server, in effect upgrading several components at once: Apache 2.2.22 -> 2.4.4, MySQL 5.5.24 -> 5.6.12, PHP 5.3.13 -> 5.4.12, WordPress 3.1.2 -> 3.5.2. I know this hardly pins anything down, sorry.

    Thanks in advance for any tips about work-arounds.

    http://wordpress.org/extend/plugins/pagerestrict/

  2. anfal_muhammad
    Member
    Posted 11 months ago #

    I got the same error
    Warning: Creating default object from empty value in C:\xampp\htdocs\site\wp-content\plugins\pagerestrict\pagerestrict.php on line 76
    Does anyone have solution?

  3. Frank Hagan
    Member
    Posted 11 months ago #

    Your web host probably upgraded to PHP 5.4. I had this crop up on my server when I upgraded this week. My understanding is that this error message really doesn't DO anything other than annoy you, so its safe to turn off the display of it.

    In wp-config.php, put this line:

    ini_set( 'display_errors', 0 );

    I put it near the top, under:

    * @package WordPress
    */

  4. anfal_muhammad
    Member
    Posted 11 months ago #

    Thanks for the help it worked.

Reply

You must log in to post.

About this Plugin

About this Topic