전송 파일 설정

2153 단어
PHP INI
php. ini 를 열 고 먼저 찾 습 니 다.
  • file_uploads = on ;HTTP 를 통 해 파일 을 업로드 하 는 스위치 를 허용 할 지 여부 입 니 다.기본 값 은 ON 즉 uploadtmp_dir ;서버 에 임시 파일 이 저 장 된 곳 에 파일 을 업로드 합 니 다. 지정 되 지 않 으 면 시스템 기본 임시 폴 더 uploadmax_filesize = 8m ;망 문 사업, 즉 파일 크기 의 최대 치 를 업로드 할 수 있 습 니 다.기본 값 2M postmax_size = 8m ;폼 POST 를 통 해 PHP 에 받 을 수 있 는 최대 값 을 말 합 니 다. 폼 의 모든 값 을 포함 합 니 다.기본 값 은 8M 입 니 다. 상기 네 개의 인 자 를 설정 한 후에 < = 8M 파일 을 업로드 하 는 것 은 문제 가 되 지 않 습 니 다. 네트워크 가 정상 적 인 상황 에서.그러나 > 8M 의 부피 가 큰 파일 을 업로드 하려 면 상기 네 가지 만 설정 하면 반드시 통 할 수 있 습 니 다

  • 다음 매개 변수 max 추가 설정execution_time = 600 ;PHP 페이지 당 최대 시간 (초), 기본 30 초 maxinput_time = 600 ;PHP 페이지 마다 데 이 터 를 받 는 데 걸 리 는 최대 시간, 기본 60 초 memorylimit = 8m ;PHP 페이지 마다 먹 는 최대 메모리 입 니 다. 기본적으로 8M 는 상기 매개 변 수 를 수정 한 후 네트워크 가 허용 하 는 정상 적 인 상황 에서 부피 가 큰 파일 을 업로드 할 수 있 습 니 다.
    max_execution_time = 600
    max_input_time = 600
    memory_limit = 32m
    file_uploads = on
    upload_tmp_dir = /tmp
    upload_max_filesize = 32m
    post_max_size = 32m
    

    해당 서버 nginx 의 프로필 설정: cd / export / server / nginx / conf / nginx. conf, 이 프로필 에 있 는 server 세그먼트 에 있 는
    location / {  
                root   html;  
                index  index.html index.htm;  
                client_max_body_size    1000m;  
      }  
    
       client_max_body_size      ,       。                  :
    
    sendfile        on;  
    #tcp_nopush     on;  
              
    #keepalive_timeout  0;  
    keepalive_timeout  65;  
                
    #gzip  on;  
    include domains/*;  #########################           
    #include domains/chat.local;  
    #include domains/chat.erp.com;  
    #include domains/support.chat.com;  
    #include douains/chat.com;    
    server {  
        listen       80;   
        server_name  localhost;   
    
    include domains
    

    명령 은 파일 을 할당 할 경 로 를 지정 합 니 다.할당 파일 을 찾 은 후 할당 파일 에서 수정 합 니 다.할당 파일 설정 은 다음 과 같 습 니 다:
    server  
    {  
        listen   80;  
        server_name  chat.erp.360buy.com;  
        #access_log    /export/servers/nginx/logs/chat.erp.360buy.com;  
        location / {  
            proxy_pass     http://tomcat;  
            client_max_body_size    1000m;  
        }  
    }  
     /export/servers/nginx/sbin/nginx -s reload   ,                。

    좋은 웹페이지 즐겨찾기