PHP Fatal error allowed memory size exhausted

前端 未结 5 540
故里飘歌
故里飘歌 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:41

    The problem occurs because a private method kept calling itself over and over again until the allocated memory is exhausted and the script stops execution

    private function get_member_data($tid){
        return $this->get_member_data($tid);
    }
    

    This is a stupid human error, the above method should have been re-written as below

    private function get_member_data($tid){
    //Call to model method
        return $this->invest->get_member_data($tid);
    }
    

    Sorry, and thanks everyone.

提交回复
热议问题