0

I created simple Action based on this tutorial (the same entities and stuff).

$em = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');
$dql = "SELECT b, e, r FROM Bug b JOIN b.engineer e JOIN b.reporter r ORDER BY b.created DESC";

$query = $em->createQuery($dql);
$query->setMaxResults(30);
$bugs = $query->getResult();

And now Zend just throws 500 without any information. By commenting the lines I found out that tha problem occures on $bugs = $query->getResult(); line but I have no information - just 500 (even apache error log is empty). Are there any tools for debug?

Tomasz Kapłoński
  • 1,320
  • 4
  • 24
  • 49
  • If you get a generic 500 error you'll need to [ensure PHP is displaying error messages](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php), and [configure ZF2 to display execptions](http://stackoverflow.com/questions/13193550/how-to-show-zf2-errors#answer-13195157). – AlexP Jun 20 '14 at 08:12
  • But how can I do this if even `ini_set` and `error_reporting` in this specific method doesn't do the job? – Tomasz Kapłoński Jun 20 '14 at 08:15
  • Once you have your `$query`, does it work if you call `getSQL()` on it? If it does not work then you have an issue with your query syntax, maybe the `FROM Bug b` part: are you sure `Bug` is a fully qualified name for this entity? Anyway @AlexP is probably right: some error output must be hidden by some configuration ;) – Stock Overflaw Jun 23 '14 at 09:17

1 Answers1

0

Check if error reporting/show exceptions is properly configured to render errors/exceptions just like @Moby04 suggested.

You should check for example if you have these lines in your application config array:

'view_manager' => array(
    'display_not_found_reason' => true, 
    'display_exceptions'       => true, 
    'not_found_template'       => 'error/404', 
    'exception_template'       => 'error/index', 
)

And make sure that the template values actually map to 'proper' view templates.

Wilt
  • 41,477
  • 12
  • 152
  • 203