• Resolved tesscorinne

    (@tesscorinne)


    I have been using Autoptimize for a while, and I love it. However, after making some changes to my site recently, I got a bunch of 500 internal server errors. After recovering and reinstalling Autoptimize, I got the “Autoptimize cannot write to the cache directory (default: /wp-content/cache/autoptimize), please fix to enable CSS/ JS optimization!” error message, which only goes away when I chmod the folder to 777. The folder didn’t need to be 777 before, so I’m not sure what I’m doing wrong.

    https://wordpress.org/plugins/autoptimize/

Viewing 11 replies - 16 through 26 (of 26 total)
  • I use git&wordpress workflow when push local repo to my remote repo, but everytime when I push to remote server, automize alway ask me to change permission to 777, 755 just does not work, it says “Autoptimize cannot write to the cache directory (default: /wp-content/cache/autoptimize), please fix to enable CSS/ JS optimization!”

    and I have used “ls -la ” to check the owner of the autoptimize folder, all are under vsftp.

    is there anything wrong?

    Plugin Author Frank Goossens

    (@futtta)

    Try excluding wp-content/cache from git, letting AO create the directory on your server after deployment?

    Thanks for your reply. I have already add “/wp-content/cache/”in my gitignore file already.

    Plugin Author Frank Goossens

    (@futtta)

    hmmm … well the basic problem is that the user under which the webserver is running is not vsftp and that the webserver-user is not in the same group as vsftp either. so some changes on group-level could allow you to go for 775 (which is better then 777)? if you want to keep 755, you’ll have to make sure the user with which you upload is the same as the user that runs the webserver.

    Thanks for your reply.

    sorry, I do know very little about the server side staff.. but I have checked the user of cache folder in wp-content, and all is showed by vsftp:

    you can see it in : http://ww4.sinaimg.cn/large/65e4f1e6gw1f8v6uysti9j20n806e42b.jpg

    Currently I always need to change autopimize folder to 777 and subfolder if I push my local git repo to web server.

    Plugin Author Frank Goossens

    (@futtta)

    and the files in wp-content/cache/autoptimize/js (i.e. the autoptimized js-files), who are those owned by?

    Plugin Author Frank Goossens

    (@futtta)

    ok, but I mean the contents of the /js/-folder (wp-content/cache/autoptimize/js) itself?

    part is belong to www, others are belong to vsftp:
    http://ww3.sinaimg.cn/large/65e4f1e6gw1f8v92w0kljj215m0d816h.jpg

    Plugin Author Frank Goossens

    (@futtta)

    well, there you have your problem; the files owned by user vsftp are the ones you deployed, the ones with user www are the ones AO creates (through your apache/ php process running under user www).

    if your directory is owned by vsftp and your permissions are 755, then apache/ php cannot write to them (as vsftp <> www). what you could try is do a post-deploy step, changing ownership (chown) of “autoptimize” (and all files in it) to www?

    (this is nothing new from AO’s point of view actually, it has always required the webserver to have write-permissions on the wp-content/cache-folder)

    Thanks! It works!

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘The autoptimize cache directory suddenly requires 777 permissions to work’ is closed to new replies.