天天看點

php 上傳檔案|圖檔 時候報錯 Allowed memory size of 20971520

php 上傳檔案|圖檔 時候報錯 Allowed memory size of 20971520 http://hi.baidu.com/3800_hk/blog/item/c9c08618508c5aa14bedbc81.html 2011年03月27日 星期日 16:17

報錯資訊:“Allowed memory size of 20971520 bytes exhausted (tried to allocate 2048 bytes)”

網上很多的解決方案是:

修改php.ini 檔案 把memory_limit的值改大,然後重新開機伺服器,

還有的說是在頁面加上ini_set(memory_limit, '20M');

我把上面的方法都測試過了,都無效,最終解決方法是下面的這代碼:

ini_set(memory_limit, -1);

posted on 2011-09-05 05:09  之乎者也2011 閱讀( ...) 評論( ...) 編輯 收藏

轉載于:https://www.cnblogs.com/wrmfw/archive/2011/09/05/2166921.html

php