Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to update your /.htaccess file automatically. #641

Closed
BreursICT opened this issue Dec 24, 2015 · 7 comments
Closed

Failed to update your /.htaccess file automatically. #641

BreursICT opened this issue Dec 24, 2015 · 7 comments
Labels
bug
Milestone

Comments

@BreursICT
Copy link

@BreursICT BreursICT commented Dec 24, 2015

When i try to safe the settings i get the following error "Failed to update your /.htaccess file automatically. Most likely a permissions error. Please make sure it has permissions 644 or higher (perhaps 666). Once you've done this, please try saving the ZenCache options again."

I allready checked my htaccess but nothing strange. Also checked the permissions on the htaccess file but that fine aswell.

Do you have any suggestion ?

@raamdev
Copy link
Contributor

@raamdev raamdev commented Dec 24, 2015

@BreursICT Could you show us a copy of your .htaccess file? I'd like to test it against my local installation of ZenCache to see if anything strange is going on.

@raamdev raamdev modified the milestone: Next Release (Pro) Dec 27, 2015
raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Dec 28, 2015
 Ensures that we only add/remove from the htaccess file when there's an
 option enabled that has associated htaccess rules, or when the htaccess
 file contains rules that should be removed because we've disabled all
 options that require htaccess rules.

See wpsharks/comet-cache#641
@raamdev
Copy link
Contributor

@raamdev raamdev commented Dec 28, 2015

After some research, I discovered a few issues with the htaccess utilities in ZenCache Pro v151220:

  • Every time the plugin options are saved when ZenCache is enabled, ZenCache calls addWpHtaccess(), regardless of whether or not it actually needs to (i.e., whether or not any options are enabled that require adding something to the htaccess file).
  • ZenCache does not intelligently keep track of which options are currently enabled that require htaccess rules, and as a result more code than necessary is being run each time the site owner saves the plugin options and addWpHtaccess() is called.

As a result of all this unnecessary work, I believe we're increasing the chances that the site owner might see an error message when the error message isn't even applicable (i.e., ZenCache has no reason to add/remove anything from the htaccess file).

I've submitted a PR (wpsharks/comet-cache-pro#204) that resolves these issues.

@raamdev
Copy link
Contributor

@raamdev raamdev commented Dec 28, 2015

Also reported here (internal ticket): https://websharks.zendesk.com/agent/tickets/10212

@BreursICT
Copy link
Author

@BreursICT BreursICT commented Dec 29, 2015

Hi Raam,

Thank you for your support!

So If I understand correct the error messages are not applicable, and for now I can just ignore them.

With kind regards,

Wesley de Graaf

Email: mailto:wesley@breursict.com wesley@breursict.com

Website: http://www.breursict.com http://www.breursict.com

BreursICT | Kvk 63788004 | Bunschoten | Nederland

Van: Raam Dev [mailto:notifications@github.com]
Verzonden: Monday, December 28, 2015 22:17
Aan: websharks/zencache zencache@noreply.github.com
CC: BreursICT Wesley@breursict.com
Onderwerp: Re: [zencache] Failed to update your /.htaccess file automatically. (#641)

Also reported here (internal ticket): https://websharks.zendesk.com/agent/tickets/10212


Reply to this email directly or view it on GitHub #641 (comment) . https://github.com/notifications/beacon/APqvQzT5ejxkucv7lgMtaITNY_gUM9wQks5pUZ4vgaJpZM4G7HCW.gif

@raamdev
Copy link
Contributor

@raamdev raamdev commented Dec 29, 2015

@BreursICT That is correct. If you don't have Static CDN Filters enabled (ZenCache → Plugin Options → Static CDN Filters), then any messages about being unable to write to the .htaccess file can be ignored.

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Dec 30, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Dec 30, 2015

Next Pro Release Changelog:

  • Bug Fix: Fixed an issue that was unexpectedly producing "Failed to update your /.htaccess file" error messages. The .htaccess routines are now more intelligent and take into consideration which plugin options are enabled and which options require updating the .htaccess file. This also improves performance by avoiding unnecessary read/writes to the .htaccess file. Props @patdumond. See Issue #641.
@raamdev raamdev closed this Dec 30, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Jan 3, 2016

ZenCache Pro v160103 has been released and includes changes from this GitHub Issue. See the v160103 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#641).

@wpsharks wpsharks locked and limited conversation to collaborators Jan 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants