我做的一個文件大小調整功能,當我使用非常高的分辨率的圖像,我得到這個致命的錯誤:爲什麼ini_set('memory_limit')不起作用?
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 8884 bytes) in /path/resizer.php on line 35
(resizer.php是縮放工具類) 然後,當我使用的ini_set(」 memory_limit','64MB');
..在全擋在前面:如果(isset($ _ FILES ....)) ...我得到這個致命的錯誤:
PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to
allocate 8884 bytes) in path/resizerenter code here.php on line 35
請注意,分配的內存有減少而我要求增加。 如果你知道什麼是錯的,請讓我知道。 非常感謝
你在共享主機環境? – 2012-03-29 16:59:12
可能相關:http://stackoverflow.com/questions/1386815/increase-php-memory-limit-apache-drupal6 – 2012-03-29 17:02:56
如果你在任何你沒有親自設置的環境,你可能沒有權限覆蓋PHP的.ini。此外,您可能不知道系統中有多少內存可供您進行此類更改。 – 2012-03-29 17:05:03