Announcement

Collapse
No announcement yet.

Attachments in the filesystem - Unable to write

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

  • [Forum] Attachments in the filesystem - Unable to write

    I have just migrated my site from a Windows server to a CentOS server.

    When I attempt to set the attachment storage location I get the following error:

    We attempted to write a test file to /path/to/my/attachments/directory, but we were unsuccessful. Please verify that the web server has write/delete permissions for this path.
    A couple of relevant things:
    • This directory is chmod'd to 777 (drwxrwxrwx 12 siteusername psacln 122 Nov 13 10:10 forumattachments)
    • PHP runs in safe mode but safe mode uploads to /tmp are enabled in ACP
    • /tmp is chmod to 777 (drwxrwxrwt 3 root root 120 Nov 13 05:11 tmp)
    • This is a dedicated server
    • I get the same error on all the other storage locations so i assume this is a server/config issue


    So anybody got any ideas on what to check next?

    EDIT: The server is allowing uploads as I have the DownloadsII mod installed and this is working fine
    EDIT: Also getting this "Failed to write css files. Please make sure that the directory 'clientscript/vbulletin_css' is writable.Done." when attempting to save CSS with store in filesystem enabled - It seems that it is possible to create directories but not files
    Last edited by MrEyes; Sat 13 Nov '10, 7:20am.
    This is a signature, with a picture

    sigpic

    UK Motorbike Forum

  • #2
    Enable phpinfo in the Admin CP, then provide the URL to your forums. This may help us troubleshoot this problem.

    Admin CP -> Settings -> Options -> Server Settings and Optimization Options -> Public phpinfo() Display Enabled
    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


    • #3
      Done

      URL is : therevcounter.com/forum.php?do=phpinfo

      Also noticed that while I have been trying to get this to work a "test" directory is created in the attachment folder - so like CSS it seems that directories can be created but not files.

      EDIT: It seems that if I am running in safe mode then I can't store attachments or css in the file system:

      http://www.vbulletin.org/forum/showp...87&postcount=2
      Last edited by MrEyes; Sat 13 Nov '10, 2:33pm.
      This is a signature, with a picture

      sigpic

      UK Motorbike Forum

      Comment


      • #4
        The path is /var/www/vhosts/therevcounter.com/httpdocs/ this is what you need after the last / is what you see with your FTP client so the path to admincp is /var/www/vhosts/therevcounter.com/httpdocs/admincp/ etc etc.

        Comment


        • #5
          Originally posted by we_are_borg View Post
          The path is /var/www/vhosts/therevcounter.com/httpdocs/ this is what you need after the last / is what you see with your FTP client so the path to admincp is /var/www/vhosts/therevcounter.com/httpdocs/admincp/ etc etc.
          I am attempting to set the following:

          /var/www/vhosts/therevcounter.com/httpdocs/filedata/forumattachments/
          This is a signature, with a picture

          sigpic

          UK Motorbike Forum

          Comment


          • #6
            Do not close with a /

            /var/www/vhosts/therevcounter.com/httpdocs/filedata/forumattachments should be good.

            Comment


            • #7
              Further to Lynnes comment (linked above) regarding safe mode I have disabled this and attachments are now working fine.
              This is a signature, with a picture

              sigpic

              UK Motorbike Forum

              Comment


              • #8
                Well, when I say "working fine" I mean "working fine ish"

                ACP allowed me to change the location of attachment storage, however when I try to upload a new attachment via the attachment manager page I get an error. The text of the error is:

                500 [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2038"]
                This error text is found in the title of a red exclamation mark icon that appears next to the attachment name after attempting the upload - see the attachment for a screenshot.
                Attached Files
                This is a signature, with a picture

                sigpic

                UK Motorbike Forum

                Comment


                • #9
                  I cannot check your phpinfo because your forums are closed. Create a text file with this content:

                  PHP Code:
                  <?php
                  phpinfo
                  ();
                  ?>
                  Name it 'phpinfo.php' then upload it to your forum directory and post the URL here. This will help us troubleshoot the problem.
                  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


                  • #10
                    Originally posted by Steve Machol View Post
                    I cannot check your phpinfo because your forums are closed....
                    errrr, no it isn't there are currently 120 people online posting and viewing quite happily ?!?

                    Anway, you should now be able to access phpinfo here:

                    therevcounter.com/phpinfo.php
                    This is a signature, with a picture

                    sigpic

                    UK Motorbike Forum

                    Comment


                    • #11
                      You have open_basedir restrictions on your server. To get uploads to work you need to create a 'tmp' subdirectory under your main httpdocs 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:

                      /var/www/vhosts/therevcounter.com/httpdocs/tmp

                      Admin CP -> Settings -> Options -> Server Settings and Optimization Options -> Safe Mode Temporary Directory

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


                      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


                      • #12
                        To be honest that sounds like a right old faff, I have full root access to this server and can make any change I want - would it be easier to remove the open_basedir restriction?

                        BTW this only effects attachments, I can cheerfully upload avatars, profile pics, signature pics - seems a bit odd that only attachments are effected by such a root cause.
                        Last edited by MrEyes; Sun 14 Nov '10, 8:13am.
                        This is a signature, with a picture

                        sigpic

                        UK Motorbike Forum

                        Comment


                        • #13
                          Yes, you can do that. You will very likely still need to fix the 'upload_tmp_dir' issue as well.
                          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


                          • #14
                            Therein lies the thing....

                            The open_basedir setting has two directories configured:
                            • /var/www/vhosts/therevcounter.com/httpdocs
                            • /tmp


                            So the webserver should be able to write to both those directories. Additionally ACP is already set to upload in safe mode (even though safe mode in PHP is off) and the safe upload directory is /tmp (as defined in open_basedir).

                            So in theory the server is setup as suggested and attachements should work. It does seem odd that other uploads and php triggered file writes are working fine barring attachments.
                            This is a signature, with a picture

                            sigpic

                            UK Motorbike Forum

                            Comment


                            • #15
                              Yes, if the /tmp directory exists with 1777 permissions and if you edit your php.ini file accordingly.
                              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...
                              X