Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter Fatal error: Allowed memory size of bytes exhausted
    text
    copied!<p>I'm getting this Fatal Error Message in my codeIgniter, I've already tried some answers which has the same question.</p> <p>I've already set my php.ini</p> <pre> max_execution_time = 300 max_input_time = 600 memory_limit = 128M </pre> <p>But still I'm getting the same Fatal error message, I don't know if the problem is in my code or in php settings. </p> <p>Here are some my of codes in controller:</p> <pre><code>public function blog(){ $this-&gt;load-&gt;model("blog_model"); $data["title"] = "CodeIgniter Projects - Blog"; if($this-&gt;getLastUrl() == 'blog'){ $data["result"] = $this-&gt;blog_model-&gt;getBlogs(); $this-&gt;load-&gt;view("view_blog", $data); }else{ $blog_name = $this-&gt;getLastUrl(); $data["result"] = $this-&gt;blog_model-&gt;getBlogDetails($blog_name); $data["comment"] = $this-&gt;blog_model-&gt;getBlogComments($blog_name); $this-&gt;load-&gt;view("view_blog_details", $data); //check for reply $url =$_SERVER['REQUEST_URI']; $getLast = explode("/", $url); $last = end($getLast); if($last == 'reply'){ $this-&gt;load-&gt;library('form_validation'); $this-&gt;form_validation-&gt;set_rules('name', 'Name', 'trim|required|min_length[4]|xss_clean'); $this-&gt;form_validation-&gt;set_rules('message', 'Comment', 'trim|required|min_length[4]|xss_clean'); $this-&gt;form_validation-&gt;set_rules('email', 'Email Address', 'trim|required|valid_email'); if($this-&gt;form_validation-&gt;run() == FALSE) { $this-&gt;blog(); } else { $msg = 'Message sent.'; $this-&gt;blog_model-&gt;addBlogComment(); $this-&gt;blog(); } } } } </code></pre> <p></p> <p>My main function is to add new comment in a blog, it works but it inserts duplicate data and I cant get rid of the fatal error message.</p> <p>addBlogComment Function</p> <pre> function addBlogComment(){ $data=array( 'blog_id'=> $this->input->post('blog_id'), 'name' => $this->input->post('name'), 'email' => $this->input->post('email'), 'message' => $this->input->post('message'), 'created' => date('Y-m-d H:i:s') ); $this->db->insert('comment',$data); } </pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload