Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)

前端 未结 29 2494
天涯浪人
天涯浪人 2020-11-21 22:57

I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for repor

29条回答
  •  梦如初夏
    2020-11-21 23:22

    I spent two dyas looking a solution for this and I figured out that this was cause in a call with PDO when I called

    $stmt->bindParam(":PERIOD", $period); 
    

    and the variables period was an

    empty string ''
    

    So this issue could have multiple root cause, my advice to you is that try a trial and error or a bisection method for a root cause finding, delete code and the try to search what is the line code that is failing

    Update: I also faced this error with the method $pdo->query() I used $pdo->prepare() and worked well, so, while I had

    $sql = "SELECT * FROM COURSE_DETAILS where ACTIVE = 1 AND COURSE_DETAILS_ID = $id";
    $stmt = getConnection()->query($sql);
    $courseDetails = $stmt->fetchAll(PDO::FETCH_ASSOC)
    

    then i changed this to

    $sql = "SELECT * FROM COURSE_DETAILS where ACTIVE = 1 AND COURSE_DETAILS_ID = ?";
    $stmt = getConnection()->prepare($sql);
    $stmt->execute(array($id)); 
    

    and magically the memory error dissapeared!

提交回复
热议问题