CodeIgniter Forums
Premature end of script headers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Premature end of script headers (/showthread.php?tid=18780)

Pages: 1 2


Premature end of script headers - El Forum - 05-18-2009

[eluser]SeasonedCoder[/eluser]
Whenever I execute this controller:

Code:
function index()
{
   $data = array ();
   $data['title'] = 'Malls';
   $data['body_id'] = 'malls';
   $this->load->view('malls/index', $data);
}

I get 500 Internal Server Error. I looked up the message:

Code:
[Mon May 18 07:05:52 2009] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers:
/path/to/folder/cgi-bin/php-cgi

Now, if I comment the last line in the body:

Code:
function index()
{
   $data = array ();
   $data['title'] = 'Malls';
   $data['body_id'] = 'malls';
   //$this->load->view('malls/index', $data);
}

the page loads ok (of course, it's blank)

I have been struggling with the issue for a couple of hours now. But still cannot find a solution.

Any ideas on how to fix it are highly appreciated.


Premature end of script headers - El Forum - 05-18-2009

[eluser]Dam1an[/eluser]
Is this the latest version o CI? PHP4 or 5?
Does it work with a clean install and the welcome controller?


Premature end of script headers - El Forum - 05-18-2009

[eluser]SeasonedCoder[/eluser]
Howdy Dam1an, thanks for your reply.

Well, I'm trying to migrate my site from my local server to the remote one.

The weird thing is that some controllers work perfectly, but some, like this, give this error.

I've just checked PHP configuration -- it's version 4.4.9 in CGI/FastCGI mode.


Premature end of script headers - El Forum - 05-18-2009

[eluser]Dam1an[/eluser]
Are you loading any extra libraries/helpers/models in this controller which you don't use in the ones that work? That might help narrow the cause


Premature end of script headers - El Forum - 05-18-2009

[eluser]SeasonedCoder[/eluser]
Code:
function Malls()
    {
        parent::Controller();
        $this->load->helper(array ('url', 'language', 'form'));
        $this->lang->load('malls', 'russian');
        $this->load->model('mall');
    }



Premature end of script headers - El Forum - 05-18-2009

[eluser]Dam1an[/eluser]
Do you use the malls model and mall russian language file in any other controllers?
Try commenting out those 2 loads and call a function 9which doesn;t make use of them)... see if the problem goes away


Premature end of script headers - El Forum - 05-18-2009

[eluser]SeasonedCoder[/eluser]
Ok, will keep experimenting with it....


Premature end of script headers - El Forum - 05-18-2009

[eluser]Thorpe Obazee[/eluser]
You can also try uploading the files again. I got a few problems before wherein the files weren't uploaded fully. I just don't know if it's the case with yours.


Premature end of script headers - El Forum - 05-19-2009

[eluser]SeasonedCoder[/eluser]
I'm still having this problem. I re-uploaded everything -- It doesn't seem to help.


Premature end of script headers - El Forum - 05-19-2009

[eluser]Dam1an[/eluser]
Have you tried removing some of the loads as I suggested earlier to narrow the cause?