Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've set up an Nginx/PHP (both installed from Yum) environment on my Fedora 15 install, but I've run into a strange issue.

I have some projects that use Codeigniter (1.6), but they keep getting the following error:

Non-existent class: Content

The full output almost looks as if PHP starts parsing the Content.php file, but then stops partway through:

{$var})) { $this->{$var} = ''; } $this->{$var} .= ob_get_clean(); } }

An Error Was Encountered

Non-existent class: Content

The contents of Content.php are:

<?

class Content {

    function capture() {
    ob_start();
    }

    function __get($name) {
    return '';
    }

    function content_for($var) {
    if (!isset($this->{$var})) { //It stops on this line
        $this->{$var} = '';
    }
    $this->{$var} .= ob_get_clean();
    }

}

What's odd to me is that this exact same setup works just fine on Ubuntu (the projects using this setup have been live for some time, I've also set it up on several Ubuntu machines for development and have never run into this problem. I also know that PHP itself works, in general, as I can run a basic site that uses a little bit of PHP, as well as some projects that use a different framework.

From what I can tell, it runs through a number of other PHP files before getting to Content.php (it has to, just to even get to the point that tells it to load Content to begin with), so PHP works, at least for a time, but then it seems to suddenly die. There aren't any other errors in the log files, either.

What is causing this error, and how can I fix it?

share|improve this question
1  
You should compare the files php.ini used by Fedora and Ubuntu. There are probably a few different settings that make the difference. –  nozimica Oct 27 '11 at 19:14
    
@nozimica - That was it. Turns out Fedora has short_open_tags off by default. Turning it on fixed the issue. If you want to put you comment as an answer, I'd gladly mark it as accepted. :) –  Shauna Oct 28 '11 at 13:39
    
It's been added as answer. :) –  nozimica Oct 28 '11 at 15:06
add comment

1 Answer

up vote 0 down vote accepted

You should compare the files php.ini used by Fedora and Ubuntu. There are probably a few different settings that make the difference.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.