PHP Fatal error allowed memory size exhausted

前端 未结 5 542
故里飘歌
故里飘歌 2021-01-19 21:21

I\'m writing a codeigniter application, upon doing a query i get hit with the following fatal error.

Fatal error: Allowed memory size of 134217728 byt

5条回答
  •  野的像风
    2021-01-19 21:39

    Your code looks fine. Check if some function is getting called repeatedly.

    You could use

    ini_set('memory_limit', '-1');
    

    as a temporary solution. or just increase the memory_limit

    Chceck you php.ini file. If it is in the below form,

    memory_limit=8G
    

    Change that in the form of MB

    memory_limit=8192M
    

    You can also do it in your code like

    ini_set('memory_limit', '8192M'); 
    

提交回复
热议问题