2016-10-01 97 views
-1

在我的代碼,我得到這個錯誤:PHP管理內存不足錯誤

php fatal error out of memory (allocated) (tried to allocate bytes) 

我嘗試插入特定的代碼放到try catch塊,但該計劃已經停止執行。

如何管理此錯誤以確保程序繼續執行?

即,注意錯誤並繼續運行

+0

這取決於很多事情你的代碼,請 – SAM

+0

請參閱[如何提問](http://stackoverflow.com/help/how-提問)來改善您的問題併發布產生該錯誤的代碼。 – David

回答

0

php.ini中增加內存限制

set_time_limit(0); 
ini_set('memory_limit', 'XXM'); 
+0

謝謝我已經插入我的代碼:ini_set ('max_execution_time',0); ini_set('memory_limit','-1');但獲得相同的錯誤 – mydb

+0

ini_set('memory_limit','250M')此代碼是正確的工作再試一次。 –