• I am having a strange problem. I just installed the Pictorialis hacked WP and everything works but only if I chmod the upload directory to 777 after every post. Otherwise I get a ‘permission denied’ page when I click on a thumbnail. It seems like it’s not uploading pictures with the proper permissions. Any way to fix this?
    Henry.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try this reply:
    http://wordpress.org/support/4/4117
    It’s an odd file permission thing I think, but I forget how I got mine to work in the end.

    Thread Starter henry

    (@henry)

    Well, I looked at all that and tried it with no luck. Something is wrong with the script I think. All the photos upload fine and the thumbnails and intermediate sized photos are all visible, it’s only when you click for the full sized pics that it fails. It’s uploading pictures to the /pictorialis/upload directory with the wrong permissions. I would think that is the fault of the script, not sure though.
    H.

    Its a combination of the script and your server. Normally, when a server writes a file, the permissions are kept intact on the server (which is what this script assumes). If PHP/Apache is setup incorrectly on the server, this permissions error can occur.
    If you still cannot get it to work, please feel free to stop by the #wordpress channel on irc.freenode.net and I will try to help you as much as I can.
    Peace

    Thread Starter henry

    (@henry)

    I don’t really understand IRC (and therefore never use it), but maybe you could answer a couple of questions here. What part of the ‘post.php’ script controls permissions on uploading? Could I copy and paste that part of the script from the original WP ‘upload.php’ script to get this to work? Uploads work fine on my server with a regular install of WP. The Pictorialis post script does upload as the proper user, but for some reason sets the permissions at;
    “-rw——-“
    This is what the problem is. If I do a ‘chown 777 ‘filename” everything works fine.
    Henry.

    Henry, try this:
    Find this line in post.php:

    if (move_uploaded_file($_FILES['picfolder']['tmp_name'], $UploadFileName)) {

    And add this right below:

    chmod($UploadFileName, 0666);

    See if that fixes the problem.

    Thread Starter henry

    (@henry)

    Hey, thank you! That fixed the problem. I actually changed the permissions to 0644 in case that was a little more secure. I appreciate your help on this.
    Henry.

    🙂 Added to the original code. Thanks for the catch!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Pictorialis permissions issue.’ is closed to new replies.