1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Problem uploading attachments

Discussion in 'Troubleshooting and Problems' started by kaloksi, Jan 26, 2015.

  1. kaloksi

    kaloksi Member


    Since we moved to a VPS server we have been unable to upload files.

    We get message:

    copy(/home/borealis/public_html/internal_data/attachments/0/335-1b9945d046299eefb5d87f56a7b4b435.data): failed to open stream: Permission denied
    1. XenForo_Application::handlePhpError()
    2. copy() in XenForo/Helper/File.php at line 253
    3. XenForo_Helper_File::safeRename() in XenForo/DataWriter/AttachmentData.php at line 264
    4. XenForo_DataWriter_AttachmentData->_moveFile() in XenForo/DataWriter/AttachmentData.php at line 223
    5. XenForo_DataWriter_AttachmentData->_writeAttachmentFile() in XenForo/DataWriter/AttachmentData.php at line 143
    6. XenForo_DataWriter_AttachmentData->_postSave() in XenForo/DataWriter.php at line 1409
    7. XenForo_DataWriter->save() in XenForo/Model/Attachment.php at line 524
    8. XenForo_Model_Attachment->insertUploadedAttachmentData() in XenForo/ControllerPublic/Attachment.php at line 204
    9. XenForo_ControllerPublic_Attachment->actionDoUpload() in XenForo/FrontController.php at line 347
    10. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    11. XenForo_FrontController->run() in /home/borealis/public_html/index.php at line 13
    I have set 0777 to public_html//internal_data and public_html/data and all its sub folders.

    The files under /home/borealis/public_html/internal_data/attachments/0/ are set to 0644

    What else is missing to make this work?

  2. kaloksi

    kaloksi Member

    php.jpg This are my php configuration settings as well
  3. Brogan

    Brogan XenForo Moderator Staff Member

    If you are sure that the directories have been recursively chmod to 0777, also check ownership (chown).
  4. kaloksi

    kaloksi Member

    what values should chown have?
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Chown them back to your user, if they aren't already.
  6. kaloksi

    kaloksi Member

    user should be root is that it?
  7. kaloksi

    kaloksi Member

    All help would be appreciated as I will have to explain hosting company what needs to be done. Thanks
  8. kaloksi

    kaloksi Member

    Host changed again recursively to 0777 folders


    The attachments now work. The thing is that all files are also now at 0777 as they did

    chmod 0777 -R internal_data/

    chmod 0777 -R data/


    Should they be like that or the files as 0644 leaving just folders to 0777?
  9. Brogan

    Brogan XenForo Moderator Staff Member

    It was likely just the directory (0) under the parent directory which needed to be 0777.

    It won't hurt but you can chmod the files back if you wish.

Share This Page