Question

We are working on a project which is build upon Codeigniter 2. All was working great untill we updated the Apache httpd from 2.2.21 to 2.2.24. The PHP version is still the same (5.3.25).

For building views we use the Template library from Phil Sturgeon.

A controller function could look something like this:

public function index(){
    if($this->_is_logged && $this->_is_super){
        redirect('/start', 'refresh');
    }else{
        $this->template
            ->set_partial('page_header', 'web/template/page_header',$this->data)
            ->set_partial('page_footer', 'web/template/page_footer')
            ->set_partial('page_notifications', 'web/template/notification_view',$this->data)
            ->set_layout('minimum')
            ->build('start/authenticate_view');
    }
}

After the update this causes a 500 Internal server error ... However, when adding an echo before the ifstatement like this:

public function index(){
    echo $this->_is_logged.' '.$this->_is_super.' -- test --'.$this->data;
    if($this->_is_logged && $this->_is_super){
        redirect('/start', 'refresh');
    }else{
        $this->template
            ->set_partial('page_header', 'web/template/page_header',$this->data)
            ->set_partial('page_footer', 'web/template/page_footer')
            ->set_partial('page_notifications', 'web/template/notification_view',$this->data)
            ->set_layout('minimum')
            ->build('start/authenticate_view');
    }
}

The page gets build as it should with the values from the echo at the top of the page.

We allready downgraded the Apache httpd to 2.2.21 and everything worked again without changing any code. So we are sure it has something to do with the Apache version. Maybe it has to do with code used in the Template library, or some strange other thing... ?

We are running up against the walls on this one.

Is there anyone who had the same issue, knows what the problem might be, ... You would be our hero forever :)

Additional info:

  • We use DataMapper ORM for CI models
  • cPanel-version: 11.36.1 (build 6)
  • OS Linux
Was it helpful?

Solution 2

We found the problem. There was a forgotten Library we had used in an early state of the project to log messages and data in FirePhp.
Removing this file and a call to one of his functions in our base controller solved the internal server error.

OTHER TIPS

A 500 error should record an error in your error logs unless you have set it not to. try putting a htacess file in the root with something like:

php_value log_errors 1
php_value error_log /var/www/.....php-error.log

then replicating the error and seeing what is output to the log. As you say it will be to do with some conflict with apache but a 500 error is just too generic to solve.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top