What could cause a PHP error on an include statement?

Posted by J Jones on Stack Overflow See other posts from Stack Overflow or by J Jones
Published on 2010-05-20T15:33:35Z Indexed on 2010/05/20 15:50 UTC
Read the original article Hit count: 243

Filed under:
|

I've got a bug in my PHP code that's been terrorizing me for several days now.

I'm trying to clasp in a new module to an existing Magento (v1.4) site, though I'm very new to the Magento framework. I think I am pretty close to getting to "Hello, World" on a block that I want displayed in the backend, but I'm getting a 500 error when the menu item is selected.

I managed to track it down (using echo stmts) to a line in the Layout.php file (app\code\core\Mage\Core\Model\Layout.php, line 472ish):

        if (class_exists($block, false) || mageFindClassFile($block)) {
            $temp = $block;
            echo "<p>before constructor: $temp</p>";
            $block = new $block($attributes);
            echo "<p>after constructor: $temp</p>";
        }

For my block, this yields only "before constructor...", so I know this is what is failing. A little more debugging reveals that the class in $block (the new block I am trying to show) does not exist. I would have expected the __autoload function to take care of this, but none of my echos in __autoload are displaying.

As a last ditch effort, I tried an include statement in Mage.php to the absolute location of the block class, but similar before and after echos reveal that that include statement becomes the breaking line.

I'm tempted to start thinking "permissions", but I'm not well versed in the server management side of all this, and I have limited access to the test server (the test server belongs to the client).

To anticipate the question: there are no errors reported in the PHP log file. I am actually not convinced that this site is reporting errors to the log file (I haven't seen anything from this site), though the client is certain that everything is turned on.

IIS 7. Integrated mode, I'm pretty sure. Anyone know what could be causing this?

© Stack Overflow or respective owner

Related posts about php

Related posts about magento