{"id":4517755,"date":"2014-01-18T14:52:15","date_gmt":"2014-01-18T14:52:15","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-warningserrors\/"},"modified":"2016-08-21T14:54:18","modified_gmt":"2016-08-21T14:54:18","slug":"php-warningserrors","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-warningserrors\/","title":{"rendered":"PHP warnings\/errors"},"content":{"rendered":"<p>Hello,<\/p>\n<p>Thanks for developing the plugin. It&#8217;s simple and does what it says on the tin.<\/p>\n<p>I&#8217;m building a website for a friend and I&#8217;m using the plugin to fetch the latest Bitcoin price. It works well. The one problem is I keep getting alerted by New Relic (who I use to monitor the performance of WordPress and my server) that the error rate of the website in question is high. On looking at the error logs I found hundreds of these:<\/p>\n<p>PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in \/var\/www\/dev\/wordpress\/wp-content\/plugins\/cryptocurrency-ticker\/crypto-ticker.php on line 138<\/p>\n<p>PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in \/var\/www\/dev\/wordpress\/wp-content\/plugins\/cryptocurrency-ticker\/crypto-ticker.php on line 139<\/p>\n<p>The code in question is:<\/p>\n<pre><code>fwrite($cached, ob_get_contents());\nfclose($cached);<\/code><\/pre>\n<p>My PHP knowledge is limited. Any hints as what to do?<\/p>\n<p>Thanks.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/cryptocurrency-ticker\/<\/p>\n","protected":false},"template":"","class_list":["post-4517755","topic","type-topic","status-closed","hentry","topic-tag-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4517755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4517755\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4517755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}