HTTP 500 中文释义:服务器拒绝响应
对于 php 网站,多半是因为程序出错而错误显示功能未打开。swfupload 都带有调试功能,你只需打开 php 的错误输出和 swfupload 的调试功能,就可以看到问题的所在

解决方案 »

  1.   


    可以肯定不是PHP 代码有错误。因为,比如我上传一个4M的文件正常,但是5M的就会报错,因为5M的耗时长一些。
    swfupload debug开启显示的也是500错误
      

  2.   

    php 中你没打开错误提示功能,你的memory_limit  是多少。
      

  3.   


    memory_limit 200M 
    上传的文件一般小于10M
    error_reporting(E_ALL),这个也开了。没有出现什么错误信息。
      

  4.   

    php.ini 中令 display_errors=On ,改完重启服务器,然后再试试看。另外,为了确认那些参数是否改对了,可以phpinfo(); 看下。
      

  5.   

    display_errors = On仅 500 是不能判断问题的,要看到尽可能多的信息
    超时、内存溢出都不是程序的错,但还是错啊
    你还需有 print_r($_FILES); 观察上传文件信息
      

  6.   

    error_reporting(E_ALL)和display_errors = On效果是一样的吧?
    file_put_contents('xxx.txt',var_export($_FILES, true));
    我把这一句放在upload.inc.php的最前面。也没有任何文件产生。因为是FLASH上传,所以print_r不行吧我看了一下phpinfo,也都对
      

  7.   

    对了,上传成功的时候,
    file_put_contents('xxx.txt',var_export($_FILES, true));
    也没有xxx.txt文件产生。
      

  8.   

    说错了
    上传成功的时候,
    file_put_contents('xxx.txt',var_export($_FILES, true));
    有xxx.txt文件产生。
      

  9.   

    error_reporting(E_ALL)和display_errors = On效果是一样的吧?
    不要想当然!
    error_reporting(E_ALL) 的意思是检查一切错误
    display_errors = On 是打开错误显示功能(php.ini)
    不打开错误显示功能,则一旦出现错误就会是 500开启 swfupload debug 功能后,所用服务端输出的信息都会展现在浏览器中
    会有类似这样的显示
      

  10.   

    奇怪我开了debug为什么没有显示这些信息?句柄我几乎全部自定义了。现在不方便,我回家再看。谢谢了
      

  11.   

    http://download.csdn.net/detail/nixiang2012/7737841下载这个uploadify3.2.1用吧,这个牛B点
      

  12.   

    那个SWFupload还是很牛叉的我用他批量上传好多大文件都没有问题的
      

  13.   

    版版,你那个debug出的信息是显示在哪里的啊?我在settings里设置了debug:true,怎么没有显示。我是在一个弹出div层里上传的。我家网速太快了,150M的文件上传都没有错误。郁闷了。
      

  14.   

    你对比一下<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>SWFUpload Demos - Simple Demo</title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />
    <script src=/scripts/json2.js></script>
    <script type="text/javascript" src="../swfupload/swfupload.js"></script>
    <script type="text/javascript" src="../swfupload.js"></script>
    <script type="text/javascript" src="js/swfupload.queue.js"></script>
    <script type="text/javascript" src="js/fileprogress.js"></script>
    <script type="text/javascript" src="js/handlers.js"></script>
    <script type="text/javascript">
    var swfu; window.onload = function() {
    var settings = {
    // flash_url : "../swfupload/swfupload.swf",
    flash_url : "../swfupload.swf",
    upload_url: "upload.php",
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
    file_size_limit : "100 MB",
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : 100,
    file_queue_limit : 0,
    custom_settings : {
    progressTarget : "fsUploadProgress",
    cancelButtonId : "btnCancel"
    },
    debug: true, // Button settings
    button_image_url: "images/TestImageNoText_65x29.png",
    button_width: "65",
    button_height: "29",
    button_placeholder_id: "spanButtonPlaceHolder",
    button_text: '<span class="theFont">Hello</span>',
    button_text_style: ".theFont { font-size: 16; }",
    button_text_left_padding: 12,
    button_text_top_padding: 3,

    // The event handler functions are defined in handlers.js
    file_queued_handler : fileQueued,
    file_queue_error_handler : fileQueueError,
    file_dialog_complete_handler : fileDialogComplete,
    upload_start_handler : uploadStart,
    upload_progress_handler : uploadProgress,
    upload_error_handler : uploadError_1,
    upload_success_handler : uploadSuccess_1,
    upload_complete_handler : uploadComplete,
    queue_complete_handler : queueComplete // Queue plugin event
    }; swfu = new SWFUpload(settings);
         };
    function uploadSuccess_1(d) {alert(JSON.stringify(d))}
    function uploadError_1(d) { alert(d)}
    </script>
    </head>
    <body>
    <div id="header">
    <h1 id="logo"><a href="../">SWFUpload</a></h1>
    <div id="version">v2.2.0</div>
    </div><div id="content">
    <h2>Simple Demo</h2>
    <form id="form1" action="index.php" method="post" enctype="multipart/form-data">
    <p>This page demonstrates a simple usage of SWFUpload.  It uses the Queue Plugin to simplify uploading or cancelling all queued files.</p> <div class="fieldset flash" id="fsUploadProgress">
    <span class="legend">Upload Queue</span>
    </div>
    <div id="divStatus">0 Files Uploaded</div>
    <div>
    <span id="spanButtonPlaceHolder"></span>
    <input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
    </div> </form>
    </div>
    </body>
    </html>
      

  15.   

    应该是服务器配置问题。我发现一个重大现象,当上传到2分钟的时候,事实上服务器不再接受上传请求了。我在c:\windows\temp目录下看了一下临时文件,前2分钟一直在增大,2分钟之后,就不再变大了。而前台progress仍然触发。所以表面上就是一直在上传,而最后却失败。debug日志看不到的问题:
    我整个页面都是弹出层,所以debug开启之后,只出现那个红色的框,如图
      

  16.   

    debug问题已解决。缺少了个div id=content
    有用的错误日志如下:打开debug,错误是
    IO Error : File ID: SWFUpload_0_0. IO Error: Error #2038
    不打开debug,错误就是500
    网上找了很多,说什么调整 max_execution_time、max_input_time、memory_limit、post_max_size、upload_max_filesize
    全调了,其实根本不是大小问题。因为我在一个网速慢的电脑上上传一个不到10M的文件,同样错误。那么,关键问题就在于这个2分钟后服务器不再接收数据,但swf的progress却显示仍然在上传。
    max_execution_time=600
    保持HTTP连接,HTTP超时为600秒(10分钟)
    这是目前的配置,也是一样不行。关键不是文件大小,而是时长。