2008年9月18日 星期四

更改PHP 的檔案上傳限制

如果要上傳的檔案容量大於100MB

用 root 身分編輯 /etc/php.ini

max_execution_time = 300 ; //每個 script 執行時間上限, 單位是秒.
max_input_time = 300 ; //每個 script 處理輸入資料可用時間上限, 單位是秒.
memory_limit = 999M ; //每個執行中的 script 最多可使用的系統記憶體資源.
post_max_size = 800M ; //PHP 能夠接受發表文章的容量上限.
file_uploads = On ; //這個不用改, 安裝完就是 On 了, 請確定你的也是 On.
upload_max_filesize = 800M ; //允許上傳檔案的最大容量.
default_socket_timeout = 300; //Socket 無回應斷線時間上限.
mysql.connect_timeout = -1 ; //MYSQL 無回應斷線時間上限, -1 代表永遠等下去.

memory_limit > post_max_size > upload_max_size
其實可以不用到那麼大的值!

沒有留言: