Announcement

Collapse
No announcement yet.

Avatar uploading errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Avatar uploading errors

    (using VB 3.6 PL2)
    When trying to upload avatar from external URL I get the following php-error:

    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): /home/xxxxx/:/tmp:/usr/local/lib/php/) in /includes/class_upload.php on line 346
    A forum-user sees:
    Upload failed due to failure writing temporary file.
    as error message


    Direct uploading avatars to the website from a local-file however works fine. Also the server where the forum is hosted is not using PHP Safe-Mode.

    I have searched for this error and I see some other reports, but never a solution.

    I can solve this by enabling the "Safe Mode Upload" and adjust the directory for /tmp files. But if safe-mode was really enabled on the server, I would have seen this in phpinfo and could not upload avatars and attachements from a local file I think (?)

    Is this a bug in "class_upload.php", which maybe checks for a temp-directory in line 346 ?

    PHP Code:
    $this->upload['location'] = $this->registry->userinfo['permissions']['adminpermissions'] & $this->registry->bf_ugp_adminpermi
    ssions
    ['cancontrolpanel'] ? tempnam(ini_get('upload_tmp_dir'), 'vbupload') : @tempnam(ini_get('upload_tmp_dir'), 'vbupload'); 
    As I can solve it by setting Safemode ON in Vbulletin, I like to know if there are any restrictions introduced when I leave the 'safe mode' enabled in vbulletin settings ?? (are any other options blocked then ??)

  • #2
    Create a new dir called temp in your admincp directory (so you have admincp/temp)

    then go into the browser to the admincp and from Admin Control Panel > vBulletin Options > vBulletin Options > Server Settings turn on ' yes using safe_mode on ' and set the dir to admincp/temp

    Then try again.

    Comment


    • #3
      Originally posted by Floris View Post
      Create a new dir called temp in your admincp directory (so you have admincp/temp)

      then go into the browser to the admincp and from Admin Control Panel > vBulletin Options > vBulletin Options > Server Settings turn on ' yes using safe_mode on ' and set the dir to admincp/temp

      Then try again.
      I wrote this in my original message already:
      when I enter a directory and set safe_mode to on it works !

      But my server does not have safe_mode enabled and other uploads work normally without this, so I was wondering if this is just a bug in class_upload.php ?

      Second question was: are there any things which change when safe_mode is set to "on" ?? Will some other options stop working or can I just set it to "on", while the server itself is not using safe_mode ???

      Comment


      • #4
        Either safe_mode on or openbase_dir in effect, results in the same thing. Using this feature you can set your own tmp dir that is within the allowed permissions of the web servers' configuration.

        Comment


        • #5
          tks a lot
          works for me
          barroca
          Community vBulletin Brasil & Portugal

          Comment


          • #6
            Thank you for letting us know it has now been resolved. Let me know if you require any further assistance

            Comment


            • #7
              Originally posted by Floris View Post
              Either safe_mode on or openbase_dir in effect, results in the same thing. Using this feature you can set your own tmp dir that is within the allowed permissions of the web servers' configuration.
              Thanks for the info, all is clear now

              Comment


              • #8
                In case someone reads this and applies the fix above and still does not have any luck.... the fix above did NOT personally work for me but this one did....

                http://www.vbulletin.com/forum/showt...temporary+file

                All working now thanks

                Comment


                • #9
                  Originally posted by Floris View Post
                  Create a new dir called temp in your admincp directory (so you have admincp/temp)

                  then go into the browser to the admincp and from Admin Control Panel > vBulletin Options > vBulletin Options > Server Settings turn on ' yes using safe_mode on ' and set the dir to admincp/temp

                  Then try again.

                  Thanks,
                  It's worked for me.

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  X