Use 755 instead of 775 Permissions? #50
The HTML compressor works here :) apart from the 'combine CSS from <head> and <body> into fewer files' :(
The file is created...
<!-- Quick Cache HTML Compressor took 0.00719 seconds compiling CSS tag frags in checksum:
<!-- Quick Cache HTML Compressor took 0.07483 seconds (overall). -->
... and appears in the source:
<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"/>
... and the file exists:
ls -lha example/wp-content/cache/quick-cache/htmlc/public/example-com/b/3/1/4/7/
.. but trying to access it results in a 403 'forbidden' message.
This appears to be because, when it is created, the cache directory in wp-content is only accessible by the owner:
ls -lha wp-content/
drwxr-xr-x 10 ian ian 4.0K Dec 9 13:10 .
If it is made accessible to others, it works:
chmod +rx wp-content/cache
drwxr-xr-x 10 ian ian 4.0K Dec 9 13:11 .
The 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...
The text was updated successfully, but these errors were encountered:
The update that didn't fix this got me doing some more looking at the problem. If I edit the line in wp-content/plugins/quick-cache-pro/submodules/html-compressor/html-compressor/includes/core.php that actually creates the directory (#2305) so that the mkdir bit is
.. it works. At least under suphp. At least for new installations - old ones will have attempted to create that directory with 0775 permissions and suphp will have gone 'nope, have 0700 instead, you potentially naughty script!'
That just leaves you the simple :) job of testing if 0755 will work for non-suphp setups (I think it will, as whatever owns the script will be doing the writing to that directory - only the quick-cache does, yes?) and coming up with a line that checks if any existing cache directory has those permissions and, if not, chmoding them so it does.