$lock_file=nie.'.lock'; if(!file_exists($lock_file)){ $fp=fopen($lock_file,'w'); if(flock($fp,LOCK_EX)){ echo"ceshi-success"; flock($fp,LOCK_UN); fclose($fp); unlink($lock_file); }else{ unlink($lock_file); echo "系统繁忙请重新执行1" ; } }else{ echo "系统繁忙请重新执行2"; }