Title: php errors
Last modified: August 22, 2016

---

# php errors

 *  Resolved [DistrictOperator](https://wordpress.org/support/users/districtoperator/)
 * (@districtoperator)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-errors-42/)
 * WP Statistics is throwing this error in the error log about every 2 minutes:
 * [06-Feb-2015 03:28:18 UTC] PHP Fatal error: Call to a member function get_queried_object_id()
   on a non-object in /home/******/public_html/******/wp/wp-content/plugins/wp-statistics/
   includes/classes/hits.class.php on line 291
 * (I ******* my actual details)
 * Help?
 * [https://wordpress.org/plugins/wp-statistics/](https://wordpress.org/plugins/wp-statistics/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757650)
 * Replace line 291 in hits.class.php with the following:
 *     ```
       if( is_object( $wp_query ) ) {
       	$this->current_page_id = $wp_query->get_queried_object_id();
       }
       ```
   
 * Something else has unset the $wp_query object (which it shouldn’t do).
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757818)
 * Closing due to inactivity.
 *  [Daniel](https://wordpress.org/support/users/dhoffmann/)
 * (@dhoffmann)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757848)
 * Had the same messages and the fix seems to stopp them.
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757849)
 * The above fix has already been committed for the next release so you shouldn’t
   have to make the change again.
 *  Thread Starter [DistrictOperator](https://wordpress.org/support/users/districtoperator/)
 * (@districtoperator)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757850)
 * Awesome, Greg. Thanks.
 *  [Daniel](https://wordpress.org/support/users/dhoffmann/)
 * (@dhoffmann)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757852)
 * I found some more warnings in my log, which let the file grow. Anything important?
 * [Fri Mar 06 14:18:18 2015] [warn] [client ] mod_fcgid: stderr: PHP Fatal error:
   Call to a member function get_queried_object_id() on a non-object in /pages/…/
   wp-content/plugins/wp-statistics/includes/classes/hits.class.php on line 382
 * [Fri Mar 06 15:09:11 2015] [warn] [client ] mod_fcgid: stderr: PHP Warning: require_once(./
   includes/functions/purge.php) [[function.require-once](https://wordpress.org/support/topic/php-errors-42/function.require-once?output_format=md)]:
   failed to open stream: No such file or directory in /pages/…/wp-content/plugins/
   wp-statistics/schedule.php on line 121
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757853)
 * The first one not an issue, I’ll add an check for the object.
 * The second one probably means your nightly purging isn’t happening, I’ll take
   a look at it.
 *  [7thnfp_rollopack](https://wordpress.org/support/users/7thnfp_rollopack/)
 * (@7thnfp_rollopack)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757855)
 * Help me…
    since the last update of woocommerce, my site is down… with this error:
   Fatal error: Call to a member function get_queried_object_id() on a non-object
   in /web/htdocs/mysite/home/wp-content/plugins/wp-statistics/includes/classes/
   hits.class.php on line 291 I tried to replace the line 291 as suggested , but
   I have a white screen thank you
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757856)
 * You can disable a plugin by renaming/deleting the folder in the wp-content directory.
 *  [7thnfp_rollopack](https://wordpress.org/support/users/7thnfp_rollopack/)
 * (@7thnfp_rollopack)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757857)
 * I tried but it does not work , always a white screen
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757858)
 * Are you still getting the “Fatal Error” above?
 * If so you haven’t removed the directory. Otherwise check for another error.
 *  [7thnfp_rollopack](https://wordpress.org/support/users/7thnfp_rollopack/)
 * (@7thnfp_rollopack)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757859)
 * I have no more error , but I always a blank page
 *  Plugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757860)
 * I’d suggest you start disabling other plugins until you find out which one is
   giving you problems. Probably start with WooCommerce if you haven’t already disabled
   it.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘php errors’ is closed to new replies.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

## Tags

 * [PHP Fatal error](https://wordpress.org/support/topic-tag/php-fatal-error/)

 * 13 replies
 * 4 participants
 * Last reply from: [Greg Ross](https://wordpress.org/support/users/gregross/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/php-errors-42/#post-5757860)
 * Status: resolved