WordPress.org

Ready to get started?Download WordPress

Forums

Multisite uploads in a differnt folder (16 posts)

  1. rubysue
    Member
    Posted 2 years ago #

    I know there are similar posts, but I have turned up none that really address this issue:

    I would like to have all the uploads for one of my multisites reside in a folder on the same server but outside the wordpress directory. E.g. in mysite.com/foo/files instead of mysite.com/wordpress/wp-content/blogs.dir.

    I tried to change the settings Network Admin>Sites>Settings. The two settings I changed were:
    Upload Path: ../foo/files
    Fileupload URL: http://mysite.com/foo/files

    However, when I try to upload images, I get an error about permissions on the default folder, /wp-content/blogs.dir. (I can't make that writable, which is one of the reasons I want to use a different folder.)

    Is it possible to have images in a file outside the wordpress directory? If not, is there a way to reset the Settings for this blog?

  2. You should try a full path for your upload path: /home/rubysue/files/

    That said? You'd be better off trying to put a blogs.dir in there instead, having it be /home/rubysue/blogs.dir/1/files/

    That would keep the sites separate.

    (Why can't you make the blogs.dir writable? Have you tried adding in

    define('FS_CHMOD_DIR', (0755 & ~ umask()));
    define('FS_CHMOD_FILE', (0644 & ~ umask()));

    or something similar to your wp-config.php to give WP the permissions it needs?)

  3. rubysue
    Member
    Posted 2 years ago #

    Okay, I suspected as much. I'll try the wp-config and report back.

    I also have a ticket submitted to my host to ask them to set the permissions on wp-content to 775. Should that be recursive to files and folders?

    Finally, just to double check, I'm going to put the upload path back to /wp-content/blogs.dir/#/files/. Should the fileupload url be `mysite.com/wordpress/wp-content/blogs.dir/#/files/'?

    Thanks!

  4. The fileupload should be mysite.com/wordpress/files/ actually. There's a bit of magic that redirects :)

    I also have a ticket submitted to my host to ask them to set the permissions on wp-content to 775. Should that be recursive to files and folders?

    They won't let you change the permissions? You're gonna have a lot of issues running a website (including upgrading plugins and themes... and possible WP itself). Have them ONLY change the permissions on wp-content/blogs.dir

    Why are they so restrictive? Is this a function of the kind of PHP setup they have?

  5. rubysue
    Member
    Posted 2 years ago #

    Well, they run PHP in safe mode. It's a university.

    If I were going to ask for the broadest permissions change (with the least work for them) would asking for 775 on the entire wordpress directory be wise?

    Thanks!

  6. Well, they run PHP in safe mode.

    Ouch. Ouch. Okay, you will have a LOT of problems. Not with plain WordPress (out of the box, it actually works fine), but with some plugins :/

    Don't make the whole wordpress directory 755, that's unsafe. You only should need wp-content/blogs.dir

    But the code suggestion I put up?

    define('FS_CHMOD_DIR', (0755 & ~ umask()));
    define('FS_CHMOD_FILE', (0644 & ~ umask()));

    That lets WP upload with special permissions, and since it does that running as the PHP admin, you should be able to use that and upload images without issue.

  7. rubysue
    Member
    Posted 2 years ago #

    Tried that, but it still fails. I cleared the cache on my browser...Is there some sort of tmp folder in WordPress I should clear too?

  8. What's the error you're getting?

  9. rubysue
    Member
    Posted 2 years ago #

    “Photo.png” has failed to upload due to an error
    Unable to create directory /export/httpd/data/wordpress/wp-content/blogs.dir/2/files. Is its parent directory writable by the server?

  10. Silly question ... Can you upload for site #1?

  11. rubysue
    Member
    Posted 2 years ago #

    Not silly, and no:
    Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 10055 is not allowed to access /export/http/data/wordpress/wp-content/uploads owned by uid 2895 in /export/httpd/vhosts/soa/data/wordpress/wp-admin/includes/file.php on line 348

    Warning: copy(/export/httpd/data/wordpress/wp-content/uploads/Census2010.png) [function.copy]: failed to open stream: No such file or directory in /export/httpd/data/wordpress/wp-admin/includes/file.php on line 348
    5

  12. *sigh* I'm going to kick your IT department in the knee a lot.

    Can you get them to add your ID to the group that has access, perhaps? Normally you add the IDs to the apache group so they can write files etc.

  13. rubysue
    Member
    Posted 2 years ago #

    Well, I have a ticket in. You would think they would allow webmasters write permissions, no? We'll see.

  14. rubysue
    Member
    Posted 2 years ago #

    So here's the problem now. It seems that when WordPress creates the new directory under blogs.dir, it sets the owner to 'www'. So it then can't write to that directory (since it's running with my ftp credentials).

  15. That's not WP, that's PHP. I mean, WP is making the directory via PHP, which is okay, and that SHOULD be uploading images under the same account.

    What you need is to get YOUR id added to the www group!

  16. rubysue
    Member
    Posted 2 years ago #

    Thanks! Working on it. Appreciate your help.

Topic Closed

This topic has been closed to new replies.

About this Topic