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

XF 1.2 Server Error on Attachment Upload

Discussion in 'XenForo Questions and Support' started by xIsabel38, Mar 4, 2014.

  1. xIsabel38

    xIsabel38 Well-Known Member

    Need some help with a server error. This occurs when a user tries to upload attachments. XF 1.2.5

    Error Info
    ErrorException: mkdir(): Permission denied - library/XenForo/Helper/File.php:68
    Generated By: ZeleronX, 9 minutes ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handlePhpError(2, 'mkdir(): Permis...', '/home/eqarena/p...', 68, Array)
    #1 /home/eqarena/public_html/replica/forum/library/XenForo/Helper/File.php(68): mkdir('/home/eqarena/p...')
    #2 /home/eqarena/public_html/replica/forum/library/XenForo/DataWriter/AttachmentData.php(221): XenForo_Helper_File::createDirectory('/home/eqarena/p...', true)
    #3 /home/eqarena/public_html/replica/forum/library/XenForo/DataWriter/AttachmentData.php(143): XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/tmp/php8vUaW9', Array)
    #4 /home/eqarena/public_html/replica/forum/library/XenForo/DataWriter.php(1397): XenForo_DataWriter_AttachmentData->_postSave()
    #5 /home/eqarena/public_html/replica/forum/library/XenForo/Model/Attachment.php(524): XenForo_DataWriter->save()
    #6 /home/eqarena/public_html/replica/forum/library/XenForo/ControllerPublic/Attachment.php(201): XenForo_Model_Attachment->insertUploadedAttachmentData(Object(XenForo_Upload), 3)
    #7 /home/eqarena/public_html/replica/forum/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Attachment->actionDoUpload()
    #8 /home/eqarena/public_html/replica/forum/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /home/eqarena/public_html/replica/forum/index.php(13): XenForo_FrontController->run()
    #10 {main}
    Request State
    array(3) {
    ["url"] => string(125) "http://eqarena.com/replica/forum/in...4d2d2fb39e4a00035f2119b8a14&content_type=post"
    ["_GET"] => array(3) {
    ["attachments/do-upload_json"] => string(0) ""
    ["hash"] => string(32) "8a9e64d2d2fb39e4a00035f2119b8a14"
    ["content_type"] => string(4) "post"
    ["_POST"] => array(7) {
    ["Filename"] => string(6) ".2.png"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfSessionId"] => string(32) "4c808a9ea7959874f48da12969deec2c"
    ["_xfToken"] => string(8) "********"
    ["content_data"] => array(1) {
    ["thread_id"] => string(1) "3"
    ["_xfResponseType"] => string(4) "json"
    ["Upload"] => string(12) "Submit Query"
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Incorrect permissions on the server. You need to set write permissions for data and internal_data.

    If you have shell access then run these commands to recursively set permissions in those directories:

    chmod -R 777 data
    chmod -R 777 internal_data
    You might also try 755 permissions. Depending on how PHP is installed, 755 may still be writable. I have seen some server configurations throw errors with 777.

    Or many FTP clients can set permissions too (if you don't have shell access).
    xIsabel38 likes this.
  3. xIsabel38

    xIsabel38 Well-Known Member

    Thank you sir, that was it. I had just duplicated my main forum and missed that step.

Share This Page