{"action":"created","issue":{"url":"https://api.github.com/repos/websharks/html-compressor/issues/50","labels_url":"https://api.github.com/repos/websharks/html-compressor/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/websharks/html-compressor/issues/50/comments","events_url":"https://api.github.com/repos/websharks/html-compressor/issues/50/events","html_url":"https://github.com/websharks/html-compressor/issues/50","id":51426741,"number":50,"title":"Access to combined compressed CSS file is 'forbidden' because of cache directory permissions?","user":{"login":"superian","id":4901677,"avatar_url":"https://avatars.githubusercontent.com/u/4901677?v=3","gravatar_id":"","url":"https://api.github.com/users/superian","html_url":"https://github.com/superian","followers_url":"https://api.github.com/users/superian/followers","following_url":"https://api.github.com/users/superian/following{/other_user}","gists_url":"https://api.github.com/users/superian/gists{/gist_id}","starred_url":"https://api.github.com/users/superian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superian/subscriptions","organizations_url":"https://api.github.com/users/superian/orgs","repos_url":"https://api.github.com/users/superian/repos","events_url":"https://api.github.com/users/superian/events{/privacy}","received_events_url":"https://api.github.com/users/superian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-09T13:24:13Z","updated_at":"2015-01-01T22:48:09Z","closed_at":null,"body":"The HTML compressor works here :) apart from the 'combine CSS from &lt;head> and &lt;body> into fewer files' :(\r\n\r\nThe file is created...\r\n\r\n&lt;!-- Quick Cache HTML Compressor took 0.00719 seconds compiling CSS tag frags in checksum: `1a35ff3dcc73b6c08d0346c2ca31befd`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.04050 seconds fetching remote resource: `http://example.com/wp-content/themes/journalist/style.css`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00444 seconds compressing CSS w/ checksum: `aa18b43ca244653e8b9cce9de633717a`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.04791 seconds building parts based on CSS tag frags in checksum: `b3147389255003a0160261843d6f4f97`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.05766 seconds compressing/combining head/body CSS in checksum: `505fa5372e9e7f21f19a7689a79d6146`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00020 seconds compiling JS tag frags in checksum: `2baf6d80a662fbff890ae9cc1b727a78`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00034 seconds compressing/combining head JS in checksum: `505fa5372e9e7f21f19a7689a79d6146`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00001 seconds compiling JS tag frags in checksum: `6a80677ab982e087ad3bb25ff1b47044`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00021 seconds compressing/combining footer JS in checksum: `505fa5372e9e7f21f19a7689a79d6146`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00516 seconds compiling JS tag frags in checksum: `779b1e8e965b8da661b42608f069d2a5`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00726 seconds compressing inline JS in checksum: `505fa5372e9e7f21f19a7689a79d6146`. -->\r\n&lt;!-- Quick Cache HTML Compressor took 0.00880 seconds compressing HTML w/ checksum: `4080dde892a8ede6b2df33aee45fd83c`. -->\r\n\r\n&lt;!-- Quick Cache HTML Compressor took 0.07483 seconds (overall). -->\r\n&lt;!-- Quick Cache file path: /cache/quick-cache/cache/http/example.com/index.html -->\r\n&lt;!-- Quick Cache file built for (http://example.com/) in 0.48358 seconds, on: Dec 9th, 2014 @ 12:01 pm UTC. -->\r\n&lt;!-- This Quick Cache file will auto-expire (and be rebuilt) on: Dec 16th, 2014 @ 12:01 pm UTC (based on your configured expiration time). -->\r\n&lt;!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->\r\n&lt;!-- Quick Cache fully functional :-) Cache file served for (http://example.com/) in 0.00128 seconds, on: Dec 9th, 2014 @ 12:02 pm UTC. -->\r\n\r\n... and appears in the source:\r\n\r\n&lt;link type=\"text/css\" rel=\"stylesheet\" href=\"http://example.com/wp-content/cache/quick-cache/htmlc/public/example.com/b/3/1/4/7/078e2d57aa83314500e6992d396b6c33-compressor-part.css\" media=\"screen\"/>\r\n\r\n... and the file exists:\r\n\r\nls -lha example/wp-content/cache/quick-cache/htmlc/public/example-com/b/3/1/4/7/\r\ntotal 16K\r\ndrwxr-xr-x 2 ian ian 4.0K Dec  9 11:50 .\r\ndrwxr-xr-x 3 ian ian 4.0K Dec  9 11:50 ..\r\n-rw-r--r-- 1 ian ian 6.1K Dec  9 11:50 078e2d57aa83314500e6992d396b6c33-compressor-part.css\r\n\r\n.. but trying to access it results in a 403 'forbidden' message.\r\n\r\nThis appears to be because, when it is created, the cache directory in wp-content is only accessible by the owner:\r\n\r\nls -lha wp-content/\r\n\r\ndrwxr-xr-x 10 ian ian 4.0K Dec  9 13:10 .\r\ndrwxr-xr-x  5 ian ian 4.0K Nov 20 19:14 ..\r\n-rw-------  1 ian ian  63K Dec  9 13:03 advanced-cache.php\r\ndrwx------  2 ian ian 4.0K May 20  2013 blah\r\ndrwx------  3 ian ian  12K Dec  9 13:10 cache\r\n-rw-r--r--  1 ian ian    5 Dec  9 13:07 hello.html\r\n-rw-r--r--  1 ian ian   30 Jun 30  2011 index.php\r\ndrwxr-xr-x  7 ian ian 4.0K Dec  9 00:11 plugins\r\ndrwxr-xr-x  4 ian ian 4.0K Sep  4 19:16 themes\r\ndrwxr-xr-x  2 ian ian 4.0K Dec  9 00:11 upgrade\r\ndrwxr-xr-x  5 ian ian 4.0K Jan  1  2014 uploads\r\n\r\nIf it is made accessible to others, it works:\r\n\r\nchmod +rx wp-content/cache\r\nls -lha wp-content/cache\r\n\r\ndrwxr-xr-x 10 ian ian 4.0K Dec  9 13:11 .\r\ndrwxr-xr-x  5 ian ian 4.0K Nov 20 19:14 ..\r\n-rw-------  1 ian ian  63K Dec  9 13:03 advanced-cache.php\r\ndrwx------  2 ian ian 4.0K May 20  2013 blah\r\ndrwxr-xr-x  3 ian ian  12K Dec  9 13:11 cache\r\n-rw-r--r--  1 ian ian   30 Jun 30  2011 index.php\r\ndrwxr-xr-x  7 ian ian 4.0K Dec  9 00:11 plugins\r\ndrwxr-xr-x  4 ian ian 4.0K Sep  4 19:16 themes\r\ndrwxr-xr-x  2 ian ian 4.0K Dec  9 00:11 upgrade\r\ndrwxr-xr-x  5 ian ian 4.0K Jan  1  2014 uploads\r\n\r\nThe server is running Debian Wheezy using suphp, so that PHP runs 'as' the user rather than as the webserver. Normally this is fine, but this is a case where the webserver is trying to access a file as the webserver rather than as me..."},"comment":{"url":"https://api.github.com/repos/websharks/html-compressor/issues/comments/68501063","html_url":"https://github.com/websharks/html-compressor/issues/50#issuecomment-68501063","issue_url":"https://api.github.com/repos/websharks/html-compressor/issues/50","id":68501063,"user":{"login":"jaswsinc","id":1563559,"avatar_url":"https://avatars.githubusercontent.com/u/1563559?v=3","gravatar_id":"","url":"https://api.github.com/users/jaswsinc","html_url":"https://github.com/jaswsinc","followers_url":"https://api.github.com/users/jaswsinc/followers","following_url":"https://api.github.com/users/jaswsinc/following{/other_user}","gists_url":"https://api.github.com/users/jaswsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/jaswsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaswsinc/subscriptions","organizations_url":"https://api.github.com/users/jaswsinc/orgs","repos_url":"https://api.github.com/users/jaswsinc/repos","events_url":"https://api.github.com/users/jaswsinc/events{/privacy}","received_events_url":"https://api.github.com/users/jaswsinc/received_events","type":"User","site_admin":false},"created_at":"2015-01-01T22:48:09Z","updated_at":"2015-01-01T22:48:09Z","body":"> mkdir($dir, 0755, TRUE)\r\n\r\nMakes sense. Thanks for the follow-ups here! :-)"}}