{"id":257,"date":"2018-11-01T13:25:22","date_gmt":"2018-11-01T13:25:22","guid":{"rendered":"http:\/\/thegreenbrain.com.au\/blog\/?p=257"},"modified":"2018-11-01T14:36:06","modified_gmt":"2018-11-01T14:36:06","slug":"mautic-error-unable-to-create-the-cache-directory","status":"publish","type":"post","link":"https:\/\/thegreenbrain.com.au\/blog\/mautic-error-unable-to-create-the-cache-directory\/","title":{"rendered":"Mautic error &#8211; unable to create the cache directory"},"content":{"rendered":"<p>I encountered this error after a fresh install of Mautic on CentOS 7.<br \/>\nWhen I checked the error log file, here&#8217;s what I found<\/p>\n<p><code>RuntimeException: Unable to create the cache directory (\/var\/www\/html\/app\/cache\/prod)\\n - in file \/var\/www\/html\/app\/AppKernel.php - at line 536<\/code><\/p>\n<p>This error is due to write permission issue.<\/p>\n<p><strong>Solutions:<\/strong><\/p>\n<p>Run the following commands<\/p>\n<p><strong>#Set the ownership to apache<\/strong><br \/>\nsudo chown apache:apache -R \/data\/www\/html\/<\/p>\n<p><strong># Allow write only to specific dirs<\/strong><br \/>\nsudo chcon -t httpd_sys_rw_content_t \/var\/www\/html\/app\/logs -R<br \/>\nsudo chcon -t httpd_sys_rw_content_t \/var\/www\/html\/app\/cache -R<br \/>\nsudo chcon -t httpd_sys_rw_content_t \/var\/www\/html\/app\/config -R<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I encountered this error after a fresh install of Mautic on CentOS 7. When I checked the error log file, here&#8217;s what I found RuntimeException: Unable to create the cache directory (\/var\/www\/html\/app\/cache\/prod)\\n &#8211; in file \/var\/www\/html\/app\/AppKernel.php &#8211; at line 536 This error is due to write permission issue. Solutions: Run the following commands #Set the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":258,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,8],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-marketing-automation","category-mautic"],"_links":{"self":[{"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":5,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions\/269"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/media\/258"}],"wp:attachment":[{"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thegreenbrain.com.au\/blog\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}