From:             175384354 at qq dot com
Operating system: windows server 2003
PHP version:      5.3.15
Package:          *General Issues
Bug Type:         Bug
Bug description:ISAPI方式使用PHP,会导致web服务器崩溃.

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 bug report at https://bugs.php.net/bug.php?id=62837&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=62837&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=62837&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=62837&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=62837&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62837&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=62837&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=62837&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=62837&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=62837&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=62837&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=62837&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=62837&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=62837&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=62837&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=62837&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62837&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=62837&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=62837&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=62837&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=62837&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=62837&r=mysqlcfg

Reply via email to