{"id":6586,"date":"2014-04-20T13:42:53","date_gmt":"2014-04-20T13:42:53","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/php-file_put_contents-not-working-collection-of-common-programming-errors\/"},"modified":"2014-04-20T13:42:53","modified_gmt":"2014-04-20T13:42:53","slug":"php-file_put_contents-not-working-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/php-file_put_contents-not-working-collection-of-common-programming-errors\/","title":{"rendered":"PHP File_put_contents not working-Collection of common programming errors"},"content":{"rendered":"<p>Check this code:<\/p>\n<pre><code>\n<\/code><\/pre>\n<p><code>@file_get_contents<\/code> is working fine and the header location change to the downloaded file also works, but either the hit_count increase or <code>@file_put_contents<\/code> isn&#8217;t working, because the number with the file doesnt increase by 1. I&#8217;ve set the file permission to 777, but when I try to set the directory permission to 777 also I get a 500 internal server error saying &#8220;The server encountered an unexpected condition which prevented it from fulfilling the request.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check this code: @file_get_contents is working fine and the header location change to the downloaded file also works, but either the hit_count increase or @file_put_contents isn&#8217;t working, because the number with the file doesnt increase by 1. I&#8217;ve set the file permission to 777, but when I try to set the directory permission to 777 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6586","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6586"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6586\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}