Part of the EllisLab Network

Bug Report

Apache Hangs

Date: 11/14/2007 Severity: Critical
Status: Bogus Reporter: sukar
Version: 1.5.4
Keywords:

Description

I just mistyped a variable inside the VIEW in which should display a value passed from the CONTROLLER as a second parameter when invoking the VIEW.

Please help. thank you very much. Any suggestions are very appreciated.

Sincerely, marcz

Code Sample

////////////// sample controller
// i got an array declared with two subscripts, title and heading which i will pass on to the load->view function
<?php
class Blog extends Controller {

    
function index()
    
{
        $data
['title'] = "My Real Title";
        
$data['heading'] = "My Real Heading";
        
        
$this->load->view('blogview', $data);
    
}
}
?>
////////////// sample view
// in this file i just mistyped the variable $heading into $header.
<html>
<
head>
<
title><?php echo $title;?></title>
</
head>
<
body>
    <
h1><?php echo $header;?></h1>
</
body>
</
html>

Expected Result

Even if i mistyped a variable in VIEW, it should display null or throw a notice that un-initialized variable found.

Actual Result

Upon loading the page, the browser freeze and apache server hangs and unexpectedly quits.

Comment on Bug Report

Page 1 of 1 pages
Posted by: sukar on 14 November 2007 10:20pm
sukar's avatar

hi, sorry i did not post it first on the bug forum.

Posted by: Derek Jones on 15 November 2007 9:32am
Derek Jones's avatar

Hi Marcz,

I think there must be something going on in your PHP/Apache environment, as that is not reproducible in any environments I have access to.  You should indeed be receiving a PHP “Notice” error for an undefined variable.  Couple things we can check to make sure, though this is something that happens often enough with developers (typos in variable names) that I’m fairly confident that it’s not a bug in the application, or we’d have hundreds of reports.

1) If you use undefined variables in standalone PHP scripts, does it also exhibit this problem?
2) If you have PHP errors in your controllers, do you get proper error output or does Apache die?

Posted by: sukar on 25 November 2007 12:04pm
sukar's avatar

i used 3 virtual functions instead of include or require function in the view folder. And when i changed it back to include or require, now it throws the expected error notices. thanks.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?