- Mark Chang
- 0°C
- 4 年又 154 天
Fatal error Allowed memory size of 50331648 bytes exhausted tried to allocate 12288 bytes in
今天在客戶的網站系統上發現了一個問題。在上傳檔案時發生了一個錯誤:
Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 12288 bytes) in錯誤的原因:
因為php頁面消耗的最大記憶體預設是為8M,如果檔案太大或圖片太大,在讀取的時候會發生上述提示錯誤。
解決方式,我直接在該處理PHP檔案裡加入以下設定:
ini_set("memory_limit","20M");20M是可以依據自己的需求去設定。
又或者是修改.htaccess:
php_value memory_limit 20M以上紀錄~
https://innstory.com/story-Fatal error Allowed memory size of 50331648 bytes exhausted tried to allocate 12288 bytes in-2741
- 1,483
- 0
- 0

