I have a strange issue where any page load attempts simply outputs a string of PHP code. When inspecting the source code, it reveals that it's actually the entire content of a class file as shown below. This happens on a particular server and for any page request.

The same code base and database works fine on my local environment. Any idea what might be doing this?

Page doesn't load


Looking at your code, the first thing that pops out is you're using a PHP short tag to start your PHP file


You'll want to change that to


My guess if your server is setup with the short_open_tag ini set to false, which means <? will be interpreted as a regular bit of text.

| improve this answer | |
  • Hmmmm yes! I completely missed that. Thanks! – musicliftsme Sep 25 '14 at 13:58

Something about this old question just jumped out to me - in your screenshot you have created a Block which extends the Mage_Core_Block_Template class.

However, your block methods are named as actions, indicating that this may be controller code. Further, you're using loadLayout and renderLayout - both are methods that come from the Mage_Core_Controller_Varien_Action - again, controller code.

I believe that besides PHP short tags you likely have other issues here.

Hope that helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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