WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP Super Cache] Permissions issue - looking for insight into what's happening (4 posts)

  1. nv1962
    Member
    Posted 5 years ago #

    I'm quite happy with WP Super Cache, which I use in half-on mode* (since I also have Bad Behavior and that's how they play nicely together). However, I'm also seeing a slew of very regular PHP warnings showing up on the server log in series of four or five, and I'll be darned if I understood where that comes from...

    First, I'll just plop one example of such five warnings in a row, which I think are related to garbage clean up:

    [17-Aug-2009 19:30:07] PHP Warning:  fopen(/path/to/wp-content/cache/meta/20054525174a89e7ff628775.91622553.tmp) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /path/to/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 573
    [17-Aug-2009 19:30:07] PHP Warning:  fputs(): supplied argument is not a valid stream resource in /path/to/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 574
    [17-Aug-2009 19:30:07] PHP Warning:  fclose(): supplied argument is not a valid stream resource in /path/to/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 575
    [17-Aug-2009 19:30:07] PHP Warning:  unlink(/path/to/wp-content/cache/meta/wp-cache-d41d8cd98f00b204e9800998ecf8427e.meta) [<a href='function.unlink'>function.unlink</a>]: No such file or directory in /path/to/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 578
    [17-Aug-2009 19:30:07] PHP Warning:  rename(/path/to/wp-content/cache/meta/20054525174a89e7ff628775.91622553.tmp,/path/to/wp-content/cache/meta/wp-cache-d41d8cd98f00b204e9800998ecf8427e.meta) [<a href='function.rename'>function.rename</a>]: No such file or directory in /path/to/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 579

    I've deliberately changed the path, but left the meta cache filenames as-is, just to give more detail where I think it matters.

    I'm stumped: as it is a mere warning I'm not too much concerned, but given that they show up like clockwork every 15 minutes, it obviously looks like a garbage collection routine that runs into an issue.

    Oddly enough, the deletion of meta and normal cache files seems to work well, as the number of files isn't worrisome whatsoever. Obviously this is a file perms related thing, but since the files can be created and (somehow, perhaps at a later stage) be deleted, I'm stumped.

    So here are the key questions I have:

    • What's going on here? And:
    • Should I worry? Only if so:
    • What should I do to remedy this?

    Please accept the anticipated tributes, jubilations and gratitude in general toward the kind insightful soul who can deliver me from my ignorant misery here. ;-)

    *Added later: it's running half-on and with mobile support active. The other options in the (first) WP Super Cache Status section are inactive.

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Make sure your web server can write to the cache directory.
    chmod 777 cache
    chmod 777 cache/meta/

    You may have some other sort of security restrictions too.

  3. nv1962
    Member
    Posted 5 years ago #

    Wow, thanks for replying Donncha!

    I think I'm onto the core of the issue: crontab permissions.

    As you could see from my post above, creating and deleting the files by the plugin (and WP) was not a problem. What baffled me was the absolute clockwork regularity of the warnings (every 15 minutes) which just didn't make sense given the visitor-triggered garbage collection routine and I simply don't think I have such a high and sustained volume of traffic to cause that. Besides, the collection routine doesn't appear to be set every 15 minutes... Which got me on track of the crontab.

    Turns out, eons ago I gave a Fantastico install of WP a spin (yeah I know - fortunately I'll try bad ideas only once) which I trashed pretty quickly - except I apparently overlooked that it left a residual cronjob in place (one for mail collection for mail submitted posts, another to hit the WP cron script) and that, unsurprisingly, runs every 15 minutes.

    No more: I've killed the two cronjobs, and also saw that there was a perms issue with the crontab manager, so I think that's it.

    I'll let you know within half an hour whether that cleared the problem (that's when the error log should have entered another string of warnings - or hopefully not).

    Another for the bag of weird experiences to keep in mind I guess...

    Thanks so much, once more, for peeking in and letting me know that it's the webserver which should have perms. That pointed me in the alternate direction, and hopefully the solution.

  4. nv1962
    Member
    Posted 5 years ago #

    Confirmed:

    • It was indeed a crontab permissions issue. Set to 4755 and that's the end of crontab related issues.
    • The issue indeed originated in derelict residues of an erstwhile Fantastico install of WP: morale of the story is don't use Fantastico or cPanel to install WordPress - ever. Period.
    • I also notice that since I decided to completely refresh the WP Super Cache install, things now amazingly actually resemble predicted behavior... So, while before the plugin worked with a 755 permission for the cache folder, it now ceased to work (which obviously was resolved with perms set to 777). Ah - the joys of normalcy!

    Case hence closed - I'll set the topic to 'Resolved' now.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic