搞個(gè)了圖片上傳,死活不好使,后來(lái)發(fā)現(xiàn)是php參數(shù)配置的問(wèn)題。
下面總結(jié)下與文件上傳有關(guān)的php參數(shù),備忘之~
所有這些參數(shù)都在php.ini中設(shè)置。
1.file_uploads
設(shè)為On,允許通過(guò)HTTP上傳文件
2.upload_tmp_dir
文件上傳至服務(wù)器時(shí)用于臨時(shí)存儲(chǔ)的目錄,如果沒(méi)指定,系統(tǒng)會(huì)使用默認(rèn)的臨時(shí)文件夾(我的機(jī)器是/tmp)。
3.upload_max_filesize
允許上傳文件大小的最大值,默認(rèn)為2M。
4.post_max_size
Php可接收的post數(shù)據(jù)的最大值(包括表單里的所有值的總合),默認(rèn)為8M。
5.memory_limit
每個(gè)php所最占的最大內(nèi)存數(shù),這個(gè)值要大于允許上傳的文件大小。
6.max_execution_time
每個(gè)php運(yùn)行的最長(zhǎng)時(shí)間(秒),默認(rèn)30秒。
7.max_input_time
Php解析POST/GET數(shù)據(jù)的最長(zhǎng)時(shí)間(秒),默認(rèn)60秒。This sets the maximum time in seconds a scripts is allowed to parse input data, like POST and GET.It is measured from the mement of receiving all data on the server to the start of script execution.