IT News/PHP

웹서버에 파일 업로드 용량 늘리기

skyLove1982 2016. 9. 13. 18:54
반응형

웹서버에서 파일 업로드 제한 사이즈를 늘리는 방법을 소개합니다.

우선은 php.ini 파일을 열어서 수정해야할 부분이 3개가 있습니다.


1) upload_max_filesize

2) memory_limit

3) post_max_size


그런데 위 3가지중에 먼저는 업로드할 파일 사이즈(upload_max_filesize)를 정하고 나면 2번과 3번은 그 보다 더 큰 사이즈를 적어야 합니다. 왜냐하면 업로드하는 파일 사이즈 보다 전송되는 post 사이즈와 메모리 사이즈가 더 커야 온전히 파일 전송이 이루어지기 때문입니다.


아래는 phpmyadmin 을 설치하고 나온 faq.html 원문 일부입니다.

 I cannot upload big dump files (memory, HTTP or timeout problems).

The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize. There exist several workarounds if your upload is too big or your hosting provider is unwilling to change the settings:

반응형