Edit report at https://bugs.php.net/bug.php?id=62837&edit=1

 ID:                 62837
 Updated by:         larue...@php.net
 Reported by:        175384354 at qq dot com
 Summary:            ISAPI方式使用PHP,会导致web服务器崩溃.
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            *General Issues
 Operating System:   windows server 2003
 PHP Version:        5.3.15
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2012-08-16 09:09:16] 175384354 at qq dot com

其它版本的PHP没有测试过,估计也有这个问题

------------------------------------------------------------------------
[2012-08-16 09:02:11] 175384354 at qq dot com

Description:
------------
php post

Test script:
---------------
<?php
 setcookie("myup","tgy_cookie_up",time()+3600);
?>
<form action="" method="post" enctype="multipart/form-data">
        <input type="hidden" name="MAX_FILE_SIZE"    value="">
        <input type="file" name="pic" /><br>
        <input type="file" name="text" /><br>
        <input type="file" name="doc" /><br>
        <input type="file" name="pdf" /><br>
        <input type="submit" value="开始上传"/>
    </form>
<?
    $up_info=$_FILES;
    $upload_dir="upload/";  
    $typelist=array("image/gif","image/jpeg","image/pjpeg","image/png"); 
if (!is_dir( $upload_dir)) {
if (!mkdir($upload_dir))
   die ("upload_files directory doesn't exist and creation failed");
if (!chmod($upload_dir,0755))
die ("change permission to 755 failed.");
}
$handle=opendir($upload_dir);
$filelist = "";
    foreach($up_info as $k_name=>$value){   //用foreach循环 
处理多个文件的上传
    //2.判断文件是否上传错误

    if($up_info[$k_name]['error']>0){
        switch($up_info['error'][$i]){
            case 1:
                $err_info="上传的文件超过了 php.ini 中 
upload_max_filesize 选项限制的值";
                break;
            case 2:
                $err_info="上传文件的大小超过了 HTML 表单中 
MAX_FILE_SIZE 选项指定的值";
                break;
            case 3:
                $err_info="文件只有部分被上传";
                break;
            case 4:
                $err_info="没有文件被上传";
                break;
            case 6:
                $err_info="找不到临时文件夹";
                break;
            case 7:
                $err_info="文件写入失败";
                break;
            default:
                $err_info="未知的上传错误";
                break;
        }
        continue($err_info);
    }
    $exten_name=pathinfo($up_info[$k_name]['name'],PATHINFO_EXTENSION);

        do{
            $main_name=date('YmHis'.'--'.rand(100,999));        
            $new_name=$main_name.'.'.$exten_name;
        }while(file_exists($to_path.'/'.$new_name));


    //6.判断是否是上传的文件,并执行上传

    if(is_uploaded_file($up_info[$k_name]['tmp_name'])){

            
if(move_uploaded_file($up_info[$k_name]['tmp_name'],$upload_dir.'/'.$new_name)){
                echo '上传成功!<br>';
                }else{
                echo '上传文件移动失败!';
                }
        }else{
            echo '文件不是上传的文件';
            }

    }   //for循环的括号

while ($file = readdir($handle)) {
   if(!is_dir($file) && !is_link($file)) {
      $filelist .= "<a href='$upload_dir$file'>".$file."</a>";
      if ($DELETABLE)
        $filelist .= " <a href='?del=$upload_dir$file' title='delete'>x</a>";
      $filelist .= "<sub><small><small><font color=grey> ".date("d-m H:i", 
filemtime($upload_dir.$file))."</font></small></small></sub>";
      $filelist .="<br>";
   }
}
echo "COOKIE:".$HTTP_COOKIE_VARS['myup']."<br>";
echo  $filelist;

?>

Expected result:
----------------
PHP从PHP5.2.17到5.3.15 
都存在一个问题,会导致WEB服务器程序崩溃。
BUG描述:
服务器操作系统:windows server 2003
浏览器:MS IE 7.0
PHP使用方式:isapi

打开一个POST上传文件的PHP页面并上传一个文件,如果让这个上传页面闲置十几分钟以上,再次提交上传,会导致WEB服务器崩溃,而且没有任何提示。





------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62837&edit=1

Reply via email to