Skip to content


How to fix blank screens when instantiating objects in Zend Framework

In certain cases ZF will refuse to instantiate an object and exit, mainfesting as a blank screen (or ‘silent fail’). No exceptions are thrown and nothing is logged by php. Since it fails to trigger the basic mechanisms of php error reporting this kind of error can be annoying to troubleshoot. Here’s what I’ve found:

It seems to occur when instantiating a class that extends Zend_Db_Table_Abstract or other models
It always involves syntax errors in the class
The errors are not detected
It is not related to file corruption or bad characters in the source file (Zap Gremlins/ Convert to Ascii on the source does not make any difference)
File permissions are ok

HOW TO FIX IT: Try to instantiate the class from inside a Controller/Action and see what happens. Usually php will behave normally under these conditions and correctly report the error type and the line number.

Lastly, I am not sure why this problem occurs inside models but not not controllers. Also, I haven’t struck it in ZF 1.11, only 1.10 and earlier.

Share:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • Furl
  • Reddit
  • StumbleUpon
  • Technorati
  • description
  • Ma.gnolia
  • Slashdot
  • Spurl
  • Tumblr
  • TwitThis

Posted in zend framework. Tagged with , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.