Loading...

修改php.ini更改允許上傳檔案的大小

Temperature: 0 °C

Mark ChangMark Chang
author_tools

使用vi或vim開啟php.ini

#vim /etc/php/apache2/php.ini

找到以下位置並修改
可以使用?指令做查詢
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)
;Maximum size of POST data that PHP will accept.
post_max_size = 8M
;Maximum allowed size for uploaded files.
upload_max_filesize = 2M <--可上傳更大的檔案預設值是2M

使用插入做修改
i

離開vim編輯
:wq <--儲存並且離開

重新啟動 apache
#sudo /etc/init.d/apache2 restart


以上紀錄

 

https://innstory.com/story-修改phpini更改允許上傳檔案的大小-2277
PHP

Prev
 parseurl解析_URL

Next
如何增加WordPress網站的PHP時間限制 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

要如何修改Plesk空間上傳檔案大小的限制

要如何修改Plesk空間上傳...

Plesk的預設狀況下上傳檔案限制為M。 若要修改上傳限制 首先點選開發工具的PHP設定 innim...

點選檔案下載卻直接執行開啟

點選檔案下載卻直接執行開啟

遇到一個情況。 使用者開啟瀏覽器點選某個連結檔案時,不會執行下載而是直接開啟檔案。 原本如果只是圖片...

使用PHP mb_substr() 函式,擷取部分字串並記得使用UTF-8。

使用PHP mb_subst...

pexelsphotohello5 文字長度太長,一般來說我們可以使用DIV包住字串,再定義DIV的...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format