Support » Fixing WordPress » Permission denied error when writing to cache

  • Hi, I get the following error:

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/usr/local/psa/home/vhosts/’ for writing: Permission denied in /usr/local/psa/home/vhosts/ on line 498

    when using the Records plugin on my webpage ( I can’t get the theme I’m running to work with widgets, so I put <?php lastfmrecords_display(‘3month’, 4); ?> into index.php in my theme’s directory.

    How can I correct this error? I checked, and the cache directory does exist.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Change the permissions on that directory (ONLY that cache directory) to allow writing of files. Try these permissions values: 600, 660, 666. Use the lowest number that actually lets the plugin work.

    I’m afraid it required 0777 applied to the directory and the cache file within before the plugin worked.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Why in the world would it need executable access? Are you sure it won’t work with 666? Try it again.

    Leaving a directory 777 is very, very bad. Avoid that.

    Okay, directory and everything else now 666 – and I’m getting a different error:

    Fatal error: Call to undefined function lastfmrecords_display() in /usr/local/psa/home/vhosts/ on line 67

    and FileZilla won’t show the contents of the cache directory or let its permissions be changed further. This is what I get:

    Status:	Retrieving directory listing...
    Command:	CWD /httpdocs/tom/blog/wp-content/plugins/
    Response:	550 /httpdocs/tom/blog/wp-content/plugins/ Permission denied
    Error:	Failed to retrieve directory listing
    Status:	Set permissions of '/httpdocs/tom/blog/wp-content/plugins/' to '666'
    Command:	CWD /httpdocs/tom/blog/wp-content/plugins/
    Response:	550 /httpdocs/tom/blog/wp-content/plugins/ Permission denied

    And now trying to look at the plugin directory itself gives me a ‘failed to retrieve directory listing’ error. I think I’m going to have to ask tech support to delete the folder themselves, since I can’t do it using an FTP client, and give up on the idea of using this plugin. Which is a pity, since when it worked it looked better than the official plugin.

    May be totally unrelated, but I did experience similar problems to those you are having.
    I found out that this was caused when I uploaded the plugin – my server didnt like the period “.” in the “” folder and on upload changed it to “lastfm” – this gave me fatal errors, permission denied to cache folder, lines of code on my blog where the album covers should appear etc, etc.

    Via ftp, I was able to manually change the folder name back to “” and everything works fine now.

    I’m afraid it does seem to be unrelated – the folder “” was created fine.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Permission denied error when writing to cache’ is closed to new replies.