Avatar Upload Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ntwiles
    New Member
    • Feb 2008
    • 6
    • 3.6.x

    Avatar Upload Problem

    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/ntwiles:/usr/lib/php:/usr/local/lib/php:/tmp) in /includes/class_upload.php on line 346
    This message has been showing up when I try to upload avatars ever since I moved my forums to a new server. I can't make much sense of it. I think it's more of a writing permission problem than a vbulletin issue, but with my lack of knowledge on the subject I figured I should ask here first.
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Try a test upload:

    Admin CP -> Maintenance -> Diagnostics -> Upload

    What are the results of the test?

    Comment

    • Ntwiles
      New Member
      • Feb 2008
      • 6
      • 3.6.x

      #3
      file_uploads: On
      open_basedir: /home/ntwiles:/usr/lib/php:/usr/local/lib/php:/tmp safe_mode: Off
      upload_tmp_dir: None
      upload_max_filesize: 2.00 MB

      No errors occurred while opening the uploaded file for reading.

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        You have open_basedir restrictions on your server. To get uploads to work you need to create a 'tmp' subdirectory under your /home/ntwiles directory and chmod it to 777. Then in the Admin CP set "Upload In Safe Mode?" to 'Yes' and point the "Safe Mode Temp Directory" to that directory. If you placed the tmp directory in the right place, the path to the Safe Mode Temp Directory will be:

        /home/ntwiles/tmp

        Also the php.ini setting for 'upload_tmp_dir' is empty. It's possible you (as root) or your host will need to edit php.ini and set 'upload_tmp_dir' to point to the full path to a directory on the server that is chmod'd to 1777. You will also need to restart Apache after making this change.
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • Ntwiles
          New Member
          • Feb 2008
          • 6
          • 3.6.x

          #5
          Ok thanks for the help. I'll try that out and see where to go from there.

          Comment

          • Septic_Schizo
            New Member
            • Aug 2007
            • 3

            #6
            I've got the same problem.
            Diagnostics say

            file_uploads: on
            open_basedir: /var/kunden/webs/Toq/vBulletin/:/tmp/
            safe_mode: on
            upload_tmp_dir: -
            upload_max_filesize: 10,00 MB


            I created a directory called tmp in that place and set the chmod to 777.
            Is the missing upload_tmp_dir the problem or something else?
            Is the colon in "/var/kunden/webs/Toq/vBulletin/:/tmp/" correct?

            Comment

            • Jake Bunce
              Senior Member
              • Dec 2000
              • 46598
              • 3.6.x

              #7
              Does the test upload fail? safe_mode is on and there is an open_basedir restriction, so you might need to enable safe mode in your:

              Admin CP -> vBulletin Options -> Server Settings and Optimization Options -> Safe Mode Upload Enabled

              Also try setting the Safe Mode Temporary Directory to this:

              /tmp

              Comment

              • Septic_Schizo
                New Member
                • Aug 2007
                • 3

                #8
                Originally posted by Jake Bunce
                Does the test upload fail? safe_mode is on and there is an open_basedir restriction, so you might need to enable safe mode in your:

                Admin CP -> vBulletin Options -> Server Settings and Optimization Options -> Safe Mode Upload Enabled

                Also try setting the Safe Mode Temporary Directory to this:

                /tmp
                Yep, Safe Mode Upload is enabled and the temporary directory is set to /tmp.

                Can't the missing value for the upload_tmp_dir in the php.ini be the problem?
                Unfortunately, I can't edit it and I can't reach my host ...

                edit: My phpinfo:
                Last edited by Septic_Schizo; Sat 12 Apr '08, 2:22am.

                Comment

                • Jake Bunce
                  Senior Member
                  • Dec 2000
                  • 46598
                  • 3.6.x

                  #9
                  Yes that might be a problem. Your host is probably the only one who can change that.

                  Comment

                  • Septic_Schizo
                    New Member
                    • Aug 2007
                    • 3

                    #10
                    We solved the problem a few days ago and I just want to describe the solution for people who might encounter the same problem.

                    The upload_tmp_dir was the problem. We had no open_basedir restriciton and the safe_mode in php.ini was turned off.
                    So we just disabled safe_mode in Admin CP and entered a specific upload_tmp_dir in php.ini. Thats all.
                    With safe_mode enabled but without an upload_tmp_dir it didn't work.

                    Comment

                    • obmob
                      Senior Member
                      • Sep 2001
                      • 278

                      #11
                      Hmm... i'mgetting the same problem, idon't see safe mode problem, butphpinfo has no upload_tmp_dir, thanks!
                      Currently working on:
                      Anizeen - What anime have you seen?
                      Osito Barrigón - Winnie Pooh y sus Amigos

                      Comment

                      • Skyline_GTR
                        Senior Member
                        • Jun 2003
                        • 169

                        #12
                        I got this

                        file_uploads: On open_basedir: /home/forumzpl/:/usr/lib/php:/usr/local/lib/php:/tmp safe_mode: Off upload_tmp_dir: None upload_max_filesize: 100.00 MB
                        but that error still appearing.

                        Comment

                        • Steve Machol
                          Former Customer Support Manager
                          • Jul 2000
                          • 154488

                          #13
                          Please start your own thread with all the relevant details. Thank you.
                          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                          Change CKEditor Colors to Match Style (for 4.1.4 and above)

                          Steve Machol Photography


                          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                          Comment

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