Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP上传错误2(最大文件大小)_Php_File Upload_Mahara - Fatal编程技术网

PHP上传错误2(最大文件大小)

PHP上传错误2(最大文件大小),php,file-upload,mahara,Php,File Upload,Mahara,我们的Mahara网站存在问题,无论大小,我们都无法上传任何文件 深入研究代码,$\u文件数组将返回以下内容: Array ( [userfile] => Array ( [name] => Array ( [0] => file.jpg ) [type] => Array ( [0] =

我们的Mahara网站存在问题,无论大小,我们都无法上传任何文件

深入研究代码,$\u文件数组将返回以下内容:

Array
(
    [userfile] => Array
    (
        [name] => Array
            (
                [0] => file.jpg
            )

        [type] => Array
            (
                [0] => 
            )

        [tmp_name] => Array
            (
                [0] => 
            )

        [error] => Array
            (
                [0] => 2
            )

        [size] => Array
            (
                [0] => 0
            )

    )
)

现在,我已经检查了我们的php ini设置(并检查它们是否应用于phpinfo()):

我们有:

立柱最大尺寸4000M

上传最大文件大小4000M

文件上传到

max_文件上传20

内存限制128M

最大执行时间600

上传\u tmp\u目录“无值”

我不确定upload_tmp_dir是否应该有什么内容,但我们在这台服务器上运行了两个网站,另一个网站上传文件没有问题,所以我假设这不是问题所在

据我所知,我们的服务器设置很好

在表单的HTML中:

<div id="instconf_artefactid_upload_container" class="fileupload">
  <input type="hidden" name="instconf_artefactid_uploadnumber" id="instconf_artefactid_uploadnumber" value="1"><input type="hidden" name="instconf_artefactid_upload" id="instconf_artefactid_upload" value="0">
  <input type="hidden" name="MAX_FILE_SIZE" value="4194299904">
  <div id="instconf_artefactid_upload_messages"></div>

  <table class="fileuploadlicense"><tbody></tbody></table>
  <div class="uploadform">
    <label for="instconf_artefactid_userfile">Upload file</label>
      <span id="instconf_artefactid_userfile_container"><input type="file" class="file" id="instconf_artefactid_userfile" name="userfile[]" multiple="" size="20"></span>
      <span id="instconf_artefactid_userfile_maxuploadsize">(Maximum upload size 3.9GB)</span>

  </div>

  <div id="file_dropzone_container" class="instconf_artefactid">
      <div id="fileDropzone" class="dropzone-previews" style="display:none;">
        <div class="dz-message">Drop files here to upload</div>
      </div>
  </div>
  <div class="uploadform">
    <div id="instconf_artefactid_uploadsubmit_container">

      <noscript>&amp;lt;input type="submit" class="submit" name="instconf_artefactid_upload" id="instconf_artefactid_upload" value="Upload" /&amp;gt;</noscript>
    </div>
  </div>

</div>

上传文件
(最大上载大小3.9GB)
把文件放在这里上传
&;书信电报;输入type=“submit”class=“submit”name=“instconf\u artifactid\u upload”id=“instconf\u artifactid\u upload”value=“upload”/&;燃气轮机;
因此,表单的最大文件大小为4194299904,但无论我尝试上传什么文件,即使是大约100字节的1像素图像,我也会遇到同样的错误

在CentOS服务器上运行的Mahara的所有实例上似乎都是一样的,但在我的Windows localhost上,上传工作正常

有人知道这可能是什么原因吗

谢谢

如果您想要完整格式的HTML,它是:

    <form class="pieform" name="instconf" method="post" action="" id="instconf" enctype="multipart/form-data">
<table cellspacing="0" border="0" class="maharatable"><tbody>
    <tr id="instconf_title_header" class="text">
        <th><label for="instconf_title">Block title</label></th>
    </tr>
    <tr id="instconf_title_container" class="text">
        <td><input type="text" class="text autofocus" id="instconf_title" name="title" tabindex="0" maxlength="255" aria-describedby="" value="Image"></td>
    </tr>
    <tr id="instconf_artefactid_header" class="filebrowser">
        <th><label for="instconf_artefactid">Image</label></th>
    </tr>
    <tr id="instconf_artefactid_container" class="filebrowser">
        <td><p id="instconf_artefactid_empty_selectlist">No files found</p>
<table id="instconf_artefactid_selectlist" class="fullwidth hidden">
 <thead>
  <tr>
   <th></th>
   <th>Name</th>
   <th>Description</th>
   <th></th>
  </tr>
 </thead>
 <tbody>

 </tbody>
</table>





<input type="hidden" name="folder" id="instconf_artefactid_folder" value="0">
<input type="hidden" name="instconf_artefactid_changefolder" id="instconf_artefactid_changefolder" value="">
<input type="hidden" name="instconf_artefactid_foldername" id="instconf_artefactid_foldername" value="Home">

<div id="instconf_artefactid_open_upload_browse_container" class="hidden">
<input type="submit" class="buttondk" id="instconf_artefactid_open_upload_browse" name="browse" value="Select a file">
</div>


<div id="instconf_artefactid_upload_browse" class="upload_browse select">



<input type="hidden" name="instconf_artefactid_owner" id="instconf_artefactid_owner" value="user">
<input type="hidden" name="instconf_artefactid_ownerid" id="instconf_artefactid_ownerid" value="">
<input type="hidden" name="instconf_artefactid_changeowner" id="instconf_artefactid_changeowner" value="">
<div id="instconf_artefactid_ownertabs">
<ul class="artefactchooser-tabs files">
    <li class="current"><a class="changeowner" href="http://mahara.bedford.ac.uk/view/blocks.php?id=5708&amp;amp;change=1&amp;amp;action_configureblockinstance_id_30008=1&amp;amp;owner=user">My files<span class="accessible-hidden">(tab selected)</span></a></li>
    <li><a class="changeowner" href="http://mahara.bedford.ac.uk/view/blocks.php?id=5708&amp;amp;change=1&amp;amp;action_configureblockinstance_id_30008=1&amp;amp;owner=group">Group files<span class="accessible-hidden">(tab)</span></a></li>
    <li><a class="changeowner" href="http://mahara.bedford.ac.uk/view/blocks.php?id=5708&amp;amp;change=1&amp;amp;action_configureblockinstance_id_30008=1&amp;amp;owner=institution">Institution files<span class="accessible-hidden">(tab)</span></a></li>
    <li><a class="changeowner" href="http://mahara.bedford.ac.uk/view/blocks.php?id=5708&amp;amp;change=1&amp;amp;action_configureblockinstance_id_30008=1&amp;amp;owner=site">Site files<span class="accessible-hidden">(tab)</span></a></li>

</ul>

</div>
<div id="artefactchooser-body">
  <div id="instconf_artefactid_ownersubtabs" class="hidden">

  </div>


<div id="instconf_artefactid_upload_container" class="fileupload">
  <input type="hidden" name="instconf_artefactid_uploadnumber" id="instconf_artefactid_uploadnumber" value="1"><input type="hidden" name="instconf_artefactid_upload" id="instconf_artefactid_upload" value="0">
  <input type="hidden" name="MAX_FILE_SIZE" value="4194299904">
  <div id="instconf_artefactid_upload_messages"></div>

  <table class="fileuploadlicense"><tbody></tbody></table>
  <div class="uploadform">
    <label for="instconf_artefactid_userfile">Upload file</label>
      <span id="instconf_artefactid_userfile_container"><input type="file" class="file" id="instconf_artefactid_userfile" name="userfile[]" multiple="" size="20"></span>
      <span id="instconf_artefactid_userfile_maxuploadsize">(Maximum upload size 3.9GB)</span>

  </div>

  <div id="file_dropzone_container" class="instconf_artefactid">
      <div id="fileDropzone" class="dropzone-previews" style="display:none;">
        <div class="dz-message">Drop files here to upload</div>
      </div>
  </div>
  <div class="uploadform">
    <div id="instconf_artefactid_uploadsubmit_container">

      <noscript>&amp;lt;input type="submit" class="submit" name="instconf_artefactid_upload" id="instconf_artefactid_upload" value="Upload" /&amp;gt;</noscript>
    </div>
  </div>

</div>

<div id="instconf_artefactid_upload_disabled" class="uploaddisabled hidden">You do not have permission to add content to this folder.</div>







<div id="instconf_artefactid_foldernav" class="foldernav">

      Home




</div>

<div id="instconf_artefactid_filelist_container">
<table id="instconf_artefactid_filelist" class="tablerenderer filelist fullwidth">
 <thead>
  <tr>
   <th></th>
   <th>Name</th>
   <th>Description</th>

     <th class="filetags">Tags</th>

     <th class="right"></th>

   <th class="right nowrap">
       <span class="accessible-hidden">Edit</span>
   </th>
  </tr>
 </thead>
 <tbody>

  <tr id="file:1886" class="r0 directory-item folder">
    <td class="icon-container">
                  <img src="http://mahara.bedford.ac.uk/theme/raw/static/images/folder.png">


    </td>
    <td class="filename">

          <a href="http://mahara.bedford.ac.uk/view/blocks.php?id=5708&amp;change=1&amp;action_configureblockinstance_id_30008=1&amp;folder=1886&amp;owner=user" id="changefolder:1886" class="changefolder" title="Go to images">
        <span class="accessible-hidden">Folder:</span>
        <span class="display-title ">images</span>
    </a>

    </td>
    <td class="filedescription">Image files</td>

        <td class="filetags"></td>

        <td class="right s nowrap">
              <input type="submit" class="btn-big-edit tag-edit submit" name="instconf_artefactid_edit[1886]" value="Edit" title="Edit">

    </td>

    <!-- Ensure space for 3 buttons (in the case of a really long single line string in a user input field -->
    <td class="right s nowrap">


    </td>
  </tr>


 </tbody>
</table>
<p>
  <a href="http://mahara.bedford.ac.uk/artefact/file/downloadfolder.php?folder=0">Download folder content as a zip file</a>
</p>


</div>

<table class="hidden">
  <tbody id="instconf_artefactid_edit_placeholder">
    <tr id="instconf_artefactid_edit_row" class="hidden editrow">
    <td></td>
    <td colspan="5" class="fileedittablewrap">
      <table class="fileedittable">
        <tbody>
          <tr>
            <th colspan="2" id="instconf_artefactid_edit_heading" class="fl">

            </th>
          </tr>
          <tr class="required">
            <th><label>Name</label> <span class="requiredmarker">*</span></th>
            <td><input type="text" class="text" name="instconf_artefactid_edit_title" id="instconf_artefactid_edit_title" value="" size="40"></td>
          </tr>
                    <tr>
            <th><label>Description</label></th>
            <td><input type="text" class="text" name="instconf_artefactid_edit_description" id="instconf_artefactid_edit_description" value="" size="40"></td>
          </tr>

          <tr class="tags">
            <th><label>Tags</label></th>
            <td>
              <div><div><a href="">Show my tags</a></div><input name="instconf_artefactid_edit_tags" size="40" id="instconf_artefactid_edit_tags" value=""> <span class="help"><a href="" onclick="contextualHelp(null,null,&quot;artefact&quot;,&quot;file&quot;,null,&quot;tags&quot;,this); return false;"><img src="http://mahara.bedford.ac.uk/theme/raw/static/images/help.png" alt="Help" title="Help"></a></span></div>
              <span> </span>
            </td>
          </tr>
          <tr>
            <td></td>
            <td class="description">Enter comma-separated tags for this item. Items tagged with 'profile' are displayed in your sidebar.</td>
          </tr>


          <tr>
            <th><label>Allow comments</label></th>
            <td><input type="checkbox" name="instconf_artefactid_edit_allowcomments" id="instconf_artefactid_edit_allowcomments"></td>
          </tr>
          <tr>
            <td></td>
            <td>
              <input type="submit" class="submit" name="instconf_artefactid_update[]" id="instconf_artefactid_edit_artefact" value="Save changes">
              <input type="submit" class="cancel" name="instconf_artefactid_canceledit" id="instconf_artefactid_edit_cancel" value="Cancel">
            </td>
          </tr>
          <tr><td colspan="2" id="instconf_artefactid_edit_messages"></td></tr>
        </tbody>
      </table>
    </td>
  </tr>

  </tbody>
</table>


</div>


</div>
</td>
    </tr>
    <tr id="instconf_showdescription_header" class="checkbox">
        <th><label for="instconf_showdescription">Show description</label></th>
    </tr>
    <tr id="instconf_showdescription_container" class="checkbox">
        <td><input type="checkbox" class="checkbox" id="instconf_showdescription" name="showdescription" tabindex="0" aria-describedby=""></td>
    </tr>
    <tr id="instconf_width_header" class="text">
        <th><label for="instconf_width">Width</label></th>
    </tr>
    <tr id="instconf_width_container" class="text">
        <td><input type="text" class="text" id="instconf_width" name="width" size="3" tabindex="0" aria-describedby="instconf_width_description " value=""></td>
    </tr>
    <tr class="text">
        <td class="description"><span id="instconf_width_description">Specify the width for your image (in pixels). The image will be scaled to this width. Leave it blank to use the original size of the image. If the original size is too big, it will be scaled to the width of the block.</span></td>
    </tr>
    <tr id="instconf_retractable_header" class="checkbox">
        <th><label for="instconf_retractable">Retractable</label></th>
    </tr>
    <tr id="instconf_retractable_container" class="checkbox">
        <td><input type="checkbox" class="checkbox" id="instconf_retractable" name="retractable" tabindex="0" aria-describedby="instconf_retractable_description "></td>
    </tr>
    <tr class="checkbox">
        <td class="description"><span id="instconf_retractable_description">Select to allow this block to be retracted when the header is clicked.</span></td>
    </tr>
    <tr id="instconf_retractedonload_header" class="checkbox">
        <th><label for="instconf_retractedonload">Automatically retract</label></th>
    </tr>
    <tr id="instconf_retractedonload_container" class="checkbox">
        <td><input type="checkbox" class="checkbox" id="instconf_retractedonload" name="retractedonload" tabindex="0" aria-describedby="instconf_retractedonload_description " disabled="disabled"></td>
    </tr>
    <tr class="checkbox">
        <td class="description"><span id="instconf_retractedonload_description">Select to automatically retract this block.</span></td>
    </tr>
    <tr id="instconf_action_configureblockinstance_id_30008_container" class="submitcancel">
        <td><input type="submit" class="submitcancel submit" id="instconf_action_configureblockinstance_id_30008" name="action_configureblockinstance_id_30008" tabindex="0" aria-describedby="" value="Save"> <input type="submit" class="submitcancel cancel" id="cancel_instconf_action_configureblockinstance_id_30008" name="cancel_action_configureblockinstance_id_30008" tabindex="0" aria-describedby="" value="Cancel"></td>
    </tr>
</tbody></table>
<input type="hidden" class="hidden" id="instconf_blockconfig" name="blockconfig" aria-describedby="" value="30008">
<input type="hidden" class="hidden" id="instconf_id" name="id" aria-describedby="" value="5708">
<input type="hidden" class="hidden" id="instconf_change" name="change" aria-describedby="" value="1">
<input type="hidden" class="hidden" id="instconf_new" name="new" aria-describedby="" value="">
<input type="hidden" class="hidden" id="instconf_sesskey" name="sesskey" aria-describedby="" value="b6WAg98wGVcOer7x">
<input type="hidden" name="pieform_instconf" aria-describedby="" value="">
</form>

标题栏
形象

未找到任何文件

名称 描述
上传文件 (最大上载大小3.9GB) 把文件放在这里上传 &;书信电报;输入type=“submit”class=“submit”name=“instconf\u artifactid\u upload”id=“instconf\u artifactid\u upload”value=“upload”/&;燃气轮机; 您没有将内容添加到此文件夹的权限。 家 名称 描述 标签 编辑 图像文件

名字* 描述 标签 为此项目输入逗号分隔的标记。带有“配置文件”标记的项目将显示在侧边栏中。 允许评论 显示描述 宽度 指定图像的宽度(以像素为单位)。图像将缩放到此宽度。保留为空以使用图像的原始大小。如果原始大小过大,则会将其缩放到块的宽度。 可伸缩 选择以允许在单击标题时收回此块。 自动收回 选择此选项可自动收回此块。
您是否尝试过降低限额以防万一?在32位平台上,保存4 GB字节所需的整数超过了PHP_INT_MAX。啊哈,我把它改为2000M,这样就行了。谢谢这是一个32位系统无法克服的缺点吗?或者有没有办法将最大大小增加到该限制之上?一般来说,解决此类限制的方法是。。。64位体系结构;-)有趣的是,我刚刚检查了我们的centos框,它是64位哦。。。这表明您已经达到了其他硬编码限制:(你有没有试过降低限制以防万一?在32位平台上,容纳4 GB字节所需的整数超过了PHP_INT_MAX。啊哈,我把它改为2000M,这样就行了。谢谢。这只是一个在32位系统上无法克服的lmiitation?还是有没有办法将最大大小提高到该限制之上?一般来说解决这些限制的方法是…64位体系结构;-)有趣的是,我刚刚检查了centos框,它是64位的哦…这表明您达到了其他硬编码限制:(