Troubleshooting of PHP errors: Difference between revisions

Jump to navigation Jump to search
Line 127: Line 127:
</pre>
</pre>


=== 錯誤訊息: Allowed memory size of XXX bytes exhausted ===
=== 錯誤訊息: Allowed memory size of XXX bytes exhausted (out of memory) ===
* 訊息: PHP Fatal error:  Allowed memory size of XXX bytes exhausted (tried to allocate XX bytes)
* 訊息: PHP Fatal error:  Allowed memory size of XXX bytes exhausted (tried to allocate XX bytes)
* 原因: 一次讀取13萬行的資料,發生錯誤
* 原因: 一次讀取13萬行的資料,發生錯誤
* 解決方法: 限制每次讀取的資料行數,例如每次只讀取 50 行的資料筆數來做處理。
* 解決方法:  
** 減少每次讀取的資料行數,例如每次只讀取 50 行的資料筆數來做處理。
** foreach 時,改用 Generators 詳見: [http://php.net/manual/en/language.generators.overview.php PHP: Generators overview - Manual]


=== 錯誤訊息: It is not safe to rely on the system's timezone settings ===
=== 錯誤訊息: It is not safe to rely on the system's timezone settings ===

Navigation menu