• I installed Flickr Photostream on a multisite network running WP 4.1 and I’m getting a permissions warning, and having no luck resolving it. The images do load from Flickr, display on the page and open in the lightbox correctly, but this warning text displays within the post at the very top.
    http://doom-magazine.net/miseryxchord/photography

    Searching instances of other sites getting this/a similar warning, I suspected it involved permissions on phpFlickrCache (which was automatically generated in wp-content/uploads) but altering them doesn’t change anything.

    Warning: fopen(/ddc747f52e2c2ee8a5a818e994bab539.cache): failed to open stream: Permission denied in /home/miseryxchord/doom-magazine.net/wp-content/plugins/flickr-photostream/phpFlickr/phpFlickr.php on line 195

    Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/miseryxchord/doom-magazine.net/wp-content/plugins/flickr-photostream/phpFlickr/phpFlickr.php on line 196

    Warning: fclose() expects parameter 1 to be resource, boolean given in /home/miseryxchord/doom-magazine.net/wp-content/plugins/flickr-photostream/phpFlickr/phpFlickr.php on line 197

    Lines 193-198 in phpFlickr.php are:

    } elseif ($this->cache == “fs”) {
    $file = $this->cache_dir . “/” . $reqhash . “.cache”;
    $fstream = fopen($file, “w”);
    $result = fwrite($fstream,$response);
    fclose($fstream);
    return $result;

    https://wordpress.org/plugins/flickr-photostream/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    I had the same problem. According to the code, system is unable to create a cache file.
    The variable $file is not correctly set, so it tries to create a file in the “root” directory of the host filesytem.

    I modified the code in this way:

    $file = “/<the_full_path_to_the_dir>/wp-content/plugins/flickr-photostream” . “/” . $reqhash . “.cache”;

    And the problem was solved. It’s just a dirty workaround!

    Regards!

    Thread Starter miseryxchord

    (@miseryxchord)

    Thanks, ordnit…

    I tried modifying the code as you did above (specifying the full path etc), but it’s not working for me. I tried installing the new updated incarnation of this plugin and going from there, but it’s having exactly the same problem.

    https://wordpress.org/plugins/flickr-justified-gallery/

    Hi,
    let me show you the code I inserted:

    186:} elseif ($this->cache == "fs") {
    187: $file = "/home/mhd-01/www.foo.bar/htdocs/wp-content/plugins/flickr-justified-gallery" . "/" . $reqhash . ".cache";
    188: //$file = $this->cache_dir . "/" . $reqhash . ".cache";

    The path has to be full. The problem persists with the new plugin, I noticed while upgrading my site! If you still face some problems, put some “echo” in the code and try to see the value of the variables.

    I hope this will help!

    Regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning "failed to open stream: Permission denied"’ is closed to new replies.