Title: Warning: Creating default object from empty value
Last modified: August 30, 2016

---

# Warning: Creating default object from empty value

 *  Resolved [Steffen Voß](https://wordpress.org/support/users/kaffeeringe/)
 * (@kaffeeringe)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/)
 * Hey! Thank you for this great implementation of Shariff. I really like the look
   of it. But sadly the statistics don’t work. When I enable it, I get a warning:
 * Fehler im Backend.
    Warning: Creating default object from empty value in /www/
   XXX/wp-content/sunrise.php on line 10 Fatal error: Call to undefined method stdClass::
   escape() in /www/XXX/wp-content/sunrise.php on line 11
 * That seems to be a W3 Total Cache File. In that line it tries says:
 *     ```
       // let the site admin page catch the VHOST == 'no'
       $wpdb->dmtable = $wpdb->base_prefix . 'domain_mapping';
       $dm_domain = $wpdb->escape( $_SERVER[ 'HTTP_HOST' ] );
       ```
   
 * [https://wordpress.org/plugins/shariff/](https://wordpress.org/plugins/shariff/)

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

 *  Plugin Author [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * (@starguide)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6335934)
 * Hey,
 * I’m using all-inkl.com as well, that should not be the problem. I suppose the
   problem is created in combination with the [WordPress MU Domain Mapping](https://wordpress.org/plugins/wordpress-mu-domain-mapping/installation/)-
   Plugin.
 * First you could try to set the tmp-folder manually. For this you’ll need to add
   the following to your wp-config.php:
 * `define("SHARIFF_BACKEND_TMPDIR","/example/path/to/tmp");`
 * Of course you need to adjust the path to a folder you would like to use for the
   temporary files shariff creates. Also make sure that the php-user has the right
   to write stuff to this folder.
 * Regards,
    JP
 *  Plugin Author [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * (@starguide)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6335936)
 * **IF** you are using the WordPress MU Domain Mapping plugin I mentioned above,
   you might want to checkout the following thread in their support forum:
 * [https://wordpress.org/support/topic/sunrise-bug-with-36-headers-already-sent-and-wpdbescape?replies=31](https://wordpress.org/support/topic/sunrise-bug-with-36-headers-already-sent-and-wpdbescape?replies=31)
 * Are you sure you are using the latest version of their plugin (0.5.5.**1**)? 
   They changed these lines, because $wpdb->escape() is actually deprecated.
 *  Thread Starter [Steffen Voß](https://wordpress.org/support/users/kaffeeringe/)
 * (@kaffeeringe)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6336062)
 * I am still working on it. Thank you for your help first of all. 😉
 * 1. Yes I am using the MU Domain Mapping. And it is version 0.5.5.1 – but I didn’t
   exchange the sunrise.php – anyway, now the error is a different one: Warning:
   Creating default object from empty value in /www/XXX/wp-content/sunrise.php on
   line 9 Fatal error: Call to undefined method stdClass::prepare() in /www/XXX/
   wp-content/sunrise.php on line 15
 * Could it be a problem that I am using HTTPS on my site?
 * 2. Setting the temp folder helped. But I mistyped the path and the error said
   the folder wasn’t writable. Maybe you could add a check if the folder actually
   exists. 😉
 *  Thread Starter [Steffen Voß](https://wordpress.org/support/users/kaffeeringe/)
 * (@kaffeeringe)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6336064)
 * It seems to be a problem with MU Domain Mapping. The domain for my site is not
   set and I can’t add it. I am going to fix that and come back and tell you the
   results. Thank you! 😉
 *  Thread Starter [Steffen Voß](https://wordpress.org/support/users/kaffeeringe/)
 * (@kaffeeringe)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6336068)
 * Whoop Whopp!
 * I added
 * `global $wpdb;`
 * at the beginning of sunrise.php and now it works perfectly. 😀
 * If you want to see it in action: [https://kaffeeringe.de/](https://kaffeeringe.de/)
   😉
 *  Plugin Author [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * (@starguide)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6336086)
 * Glad that you got it working and thank you for sharing the solution with us. 
   Always useful for other users to know, what the problem was.
 * Cheers,
    JP
 * P.S.: I will add a check, if the cache-folder exists for the future 😉

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

The topic ‘Warning: Creating default object from empty value’ is closed to new replies.

 * ![](https://ps.w.org/shariff/assets/icon.svg?rev=2006307)
 * [Shariff Wrapper](https://wordpress.org/plugins/shariff/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shariff/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shariff/)
 * [Active Topics](https://wordpress.org/support/plugin/shariff/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shariff/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shariff/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Jan-Peter](https://wordpress.org/support/users/starguide/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-35/#post-6336086)
 * Status: resolved