Title: PHP Warning GZWrite
Last modified: August 22, 2016

---

# PHP Warning GZWrite

 *  [lucidreamstate](https://wordpress.org/support/users/lucidreamstate/)
 * (@lucidreamstate)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-gzwrite/)
 * (Repost because I put this in the wrong place before)
 * Was tailing some error logs on a new installation of Hyper-Cache, and started
   to see a [similar error to the one described here](https://wordpress.org/support/topic/php-warnings-13?replies=3).
   Except instead of .dat files, it was giving me the error on plugin.php. Here’s
   the full error:
 *     ```
       PHP Warning:  gzwrite() expects parameter 1 to be resource, boolean given in /path/to/wordpress/wp-content/plugins/hyper-cache/plugin.php on line 682
       PHP Warning:  gzclose() expects parameter 1 to be resource, boolean given in /path/to/wordpress/wp-content/plugins/hyper-cache/plugin.php on line 683
       ```
   
 * From what I can tell, the error seems to occur when it fails to find the file
   set in the variable $lc_file, which is then passed to the variable $gzf. Since
   it can’t find the file, it returns a boolean of “false” and spits the error back.
 * This seems to only happen when I clear the cache and doesn’t seem to affect the
   functionality of the plugin at all, so its a pretty trivial issue. But wanted
   to put it here in case others were looking.
 * [https://wordpress.org/plugins/hyper-cache/](https://wordpress.org/plugins/hyper-cache/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * (@satollo)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-gzwrite/#post-5861801)
 * Hi, the lc_file should be a correct file path, otherwise even the lines above
   that write the plain cache file should give an error. The only way to check the
   problem is to save the $lc_file, for example with a
 * error_log($lc_file);
 * which add a line to the server error log.
    Anyway I’ll add a check to the gzopen
   function.

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning GZWrite’ is closed to new replies.

 * ![](https://ps.w.org/hyper-cache/assets/icon-256x256.png?rev=3452725)
 * [Hyper Cache](https://wordpress.org/plugins/hyper-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hyper-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hyper-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/hyper-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hyper-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hyper-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/php-warning-gzwrite/#post-5861801)
 * Status: not resolved