keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Fatal error: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone #47

Closed RavanH closed 4 years ago

RavanH commented 5 years ago

Hi, I ran into these errors in the server log: ` [21-Jan-2019 11:22:17 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTimeZone given in /home/xxxxx/public_html/wp-includes/functions.php:4610 Stack trace:

0 /home/xxxxx/public_html/wp-includes/functions.php(4610): timezone_offset_get(Object(DateTimeZone), Object(DateTime))

1 /home/xxxxx/public_html/wp-includes/class-wp-hook.php(288): wp_timezone_override_offset(false)

2 /home/xxxxx/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(false, Array)

3 /home/xxxxx/public_html/wp-includes/option.php(58): apply_filters('pre_optiongmt...', false, 'gmt_offset', false)

4 /home/xxxxx/public_html/wp-includes/functions.php(66): get_option('gmt_offset')

5 /home/xxxxx/public_html/wp-content/plugins/cache-enabler/inc/cache_enabler_disk.class.php(248): current_time('timestamp')

6 /home/xxxxx/public_html/wp-content/plugins/cache-enabler/inc/cache_enabler_disk.class.php(271): Cache_Enabler_Disk::_cache_signatur()

7 /home/xxxxx/public_html/wp in /home/xxxxx/public_html/wp-includes/functions.php on line 4610

`

No idea why or when this is caused...

svenba commented 4 years ago

Using a newer PHP version might solves this.