The MU forums have moved to WordPress.org

Problem with safe_mode (13 posts)

  1. boetter
    Member
    Posted 18 years ago #

    First of all thanks for making this wonderful application, I recently discovered it and am now trying to figure out whether or not it is stable enough for me to use with clients. My clients are rather large corporations, 20k+ employees, and would therefore have to put a large deal of trust into this.

    Ok now to the question. I have succesfully set this up the same server as I am running a normal Wordpress blog. The wordpress blog works fine and so does WPMU (almost). My only trouble is that I cannot upload files nor can I import entries because safe_mode is on. But this is causing no problems at all on the normal Wordpress blog, there I can upload just fine.

    What is the difference here? I asked my host, and it's not possible to change safe_mode here, ofcourse if I am working with a client we would buy a server, but I am just trying to test it out for now.

    Is there any way to run WPMU on a server with safe_mode on? Everything else than upload and import works very, very well!

    Thanks!

  2. itdamager
    Member
    Posted 18 years ago #

    If uploads work in regular wordpress, but not in wpmu, my only guess would be owner or group permissions providing you've already set wp-content chmod 777.

    In other words, make sure owner and group on all of your files are your normal ftp owner/group and not 1004/1004 from in the tarball.

  3. boetter
    Member
    Posted 18 years ago #

    Hmm, I am not sure what you mean, but no matter how much chmod I put on it, it still gives me an error. This is the error message in the upload dialogue:

    Warning: dir(): SAFE MODE Restriction in effect. The script whose uid/gid is 1282/1282 is not allowed to access /web/www.captive.dk/www/pusleblog/wp-inst/wp-content/blogs.dir owned by uid/gid 504/504 in /web/www.captive.dk/www/pusleblog/wp-inst/wp-content/mu-plugins/misc.php on line 19

    Warning: dir(/web/www.captive.dk/www/pusleblog/wp-inst/wp-content/blogs.dir/2/files/): failed to open dir: No such file or directory in /web/www.captive.dk/www/pusleblog/wp-inst/wp-content/mu-plugins/misc.php on line 19

    Fatal error: Call to a member function on a non-object in /web/www.captive.dk/www/pusleblog/wp-inst/wp-content/mu-plugins/misc.php on line 22

    You're welcome to try it out and http://www.pusleblog.dk

    Hope someone can help me!

  4. itdamager
    Member
    Posted 18 years ago #

    You need to change owner and group, not owner and group permissions. Use the commands chown and chgrp, not chmod.

    Looks like you probably need to set your files to 504/504 instead of 1282/1282 for it to work.

    While in /web/www.captive.dk/www/pusleblog try:

    chown -R 504:504 *

    to set all the files in one step.

  5. boetter
    Member
    Posted 18 years ago #

    From the FTP server:

    Cmd: chown -R 504:504 *
    500: CHOWN not understood

    What do I do then?

  6. itdamager
    Member
    Posted 18 years ago #

    You have to run that command from a shell. If you do not have shell access, then ask your host, they might do it for you.

  7. boetter
    Member
    Posted 18 years ago #

    I do not have shell access, I will try to ask my host but they are a bit slow :-)

    I am a total newbie to this, but is it possible to make this chown thing locally and then upload the files? I am running Mac OS X on my desktop.

  8. boetter
    Member
    Posted 18 years ago #

    I have now done some CHOWN on myself locally and uploaded it, as I can see it has changed the permissions and stuff, so it worked allright. It also removes the SAFE MODE warning from the upload dialogue, but that's the only thing. The last to errors are still there and if I make a new blog, it also displays the SAFE MODE error again. I think the CHOWN-solution is a bit to temporary for me, I am interested in running a shell prompt every day just to make sure uploading works, there must be a better way?

  9. jaseone
    Inactive
    Posted 18 years ago #

    Sounds lie you need to chown the actual wp-content directory so directories/files created in there down the track are owned by 504:504.

    You might want to look at a different host though that doesn't have the same restrictions in order to save you some grief.

  10. boetter
    Member
    Posted 18 years ago #

    What do you mean I need to chown the actual directory? I am a newbie to all of this, so explain, please :-)

    I tried to do as you said, to try another server with safe_mode off, but then I just run into even more irritating problems: http://mu.wordpress.org/forums/topic/779

    Help! :-)

  11. itdamager
    Member
    Posted 18 years ago #

    Its *not* something you'll have to do everyday to enable uploads. Ownership just needs set correctly, once.

    WPMU is for experienced admins and none of us can teach you unix basics via this forum. With that said, if WPMU is something you *must* have, then I suggest working with your hosting company to resolve.

  12. minor9th
    Member
    Posted 17 years ago #

    If anyone else is suffering this problem and doesn't have shell access to perform the necessary chown command, there's another possible way around it - make sure the uploaded file matches the ownership of all the other wordpress files on your system. If you installed wordpress yourself, chances are you uploaded the files under your own ftp username. So:

    First: upload the file you wish to import to your web server using wordpress' import feature as normal (this will create a file under wp-content/uploads/<year>/<month>/ owned by the user which runs wordpress - in my case, this is apache)

    Second: when you see the interstitial page asking you to create new users, download the newly-uploaded file via ftp from your web server. Delete it from the ftp server, and then replace it with your local copy. This will create the same file but owned by your ftp user.

    Third: continue with the import process in your browser as normal. All should import without a hitch.

  13. gecampbell
    Member
    Posted 17 years ago #

    PHP's safe_mode does not only cover permissions and ownership (see http://www.php.net/manual/en/features.safe-mode.php for complete details). The "open_basedir" directive gives PHP a list of directories that it is permitted to access. See the PHP documentation; my guess is that you'll need to put the upload directory into the open_basedir directive.

About this Topic

  • Started 18 years ago by boetter
  • Latest reply from gecampbell