SAFE MODE and open_basedir restriction. Uploading media after 3.0.1-3.3.1 update (8 posts)

  1. teddyen
    Posted 3 years ago #


    I get the error message below when trying to upload an image.

    I have recently updated from 3.0.1 to 3.3.1. I have also installed All in one SEO and Simple Facebook Connect and changed the blog title. I have tried to change the title back and deactivate the plugins without any result.

    I'm very thankful for help.

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp//Helle_Rosa.tmp) is not within the allowed path(s): (/home/web/wno15417:/var/tmp:/usr/local/lib/php:/usr/local/share/pear) in /usr/home/web/wno15417/teodortomter.no/wp-includes/functions.php on line 2340

    Warning: touch() [function.touch]: SAFE MODE Restriction in effect. The script whose uid/gid is 1722/80 is not allowed to access /tmp owned by uid/gid 0/0 in /usr/home/web/wno15417/teodortomter.no/wp-admin/includes/file.php on line 177

    Dismiss “Helle_Rosa.jpg” has failed to upload due to an error
    The uploaded file could not be moved to /usr/home/web/wno15417/teodortomter.no/wp-content/uploads/2012/01.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    You need to contact your hosts. These warnings relate to your server's current configuration.

  3. teddyen
    Posted 3 years ago #

    That is the reply I've seen on all posts regarding those errors, but it's hard to believe as the timing of the error cohere with my WP update and installation of SEO and SFC plugins. The host don't report to have changed anything on their servers either, and I've used them for six years now. I've also read that some people have tracked the error to a bad theme, so even though the error message seems to be related to the server's settings, it could be something else causing it?

    I will give them a call to hear if they've changed anything anyway, but I highly doubt it.

    Any other suggestions?

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    The host don't report to have changed anything on their servers either, and I've used them for six years now.

    Hmm... servers can change at any time - even with the best of hosts. I've had the odd "Whoops!" moment with my hosts and I've been using them for almost 10 years. What I can say, with certainty, is that the warnings relate to your server and not to anything internal to WordPress.

  5. teddyen
    Posted 3 years ago #

    Hmmm. Okay, I don't really have any knowledge to argue with that, other that what I've read. However, I run another WordPress site at the same host, and that works just fine. Thanks for the headsup regarding server changes, I'll keep that in mind for the future as well.

    What about this guy, he had the exact same problem after an WP update, and solved it by defining his temp dir as an constant in the wp-config. (http://web.archive.org/web/20100914122822/http://www.dzuchara.com/wordpress-upgrade-bug-fix)

    I tried adding "/var/tmp/" as suggested, which got rid of the open_basedir error, but not the SAFE MODE restriction error.

  6. teddyen
    Posted 3 years ago #

    I added

    define ('WP_TEMP_DIR', '/usr/home/web/wno15417/phptempfolder/');

    (not the actual path, but it refers to a folder I can access through ftp)

    to wp-config, chmodded the folder to 777 and the whole problem was solved. Does this compromise security, or impose any other problems?

  7. mrname
    Posted 3 years ago #

    Yes, 777 is generally a bad idea, unless you are doing it for a quick fix. Most shared hosting environments will allow you to edit your php.ini file. You can disable open-basedir for certain directories here. As far as safe mode, I believe you can change that with an .htaccess file.

  8. laslo
    Posted 2 years ago #

    It worked for me too!
    I'm also upgraded (not so) recently to WP 3.3.1, and I just noticed I got that same annoying error.

    So I created a new 'tmp' folder somwhere inside the WP instalation
    set it to 777 mode,
    define ('WP_TEMP_DIR', '/path/to/tmp/');

    and voila!

Topic Closed

This topic has been closed to new replies.

About this Topic