phpzend-frameworkzend-mail

Zend Stack Trace not showing up due to fatal error


I have a Zend 1.11 application that is giving me a similar fatal error when any error exists

The Error is as follows:

Fatal error: Uncaught exception 'Zend_Mail_Protocol_Exception' with message 'No connection could be made because the target machine actively refused it. ' in C:\xampp\php\pear\Zend\Mail\Protocol\Abstract.php:277 
Stack trace: 
#0 C:\xampp\php\pear\Zend\Mail\Protocol\Smtp.php(167): Zend_Mail_Protocol_Abstract->_connect('tcp://localhost...') 
#1 C:\xampp\php\pear\Zend\Mail\Transport\Smtp.php(199): Zend_Mail_Protocol_Smtp->connect()
#2 C:\xampp\php\pear\Zend\Mail\Transport\Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail() 
#3 C:\xampp\php\pear\Zend\Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail)) 
#4 C:\xampp\htdocs\test2\application\modules\default\controllers\ErrorController.php(153): Zend_Mail->send() 
#5 C:\xampp\htdocs\test2\application\modules\default\controllers\ErrorController.php(66): Default_ErrorController->SendMail('Application err...', 'An error oc...') 
#6 C:\xampp\php\pear\Zend\Controller\Action.php(516): Default_ErrorController->errorAction() 
#7 C:\xampp\php\pear\Zend\Controller\Disp in C:\xampp\php\pear\Zend\Controller\Plugin\Broker.php on line 336

This is preventing the correct stack trace from showing up (i.e this error came from an intentional misnaming of the database which would normally throw an unknow DB exception) and there is'nt really anything to do with mail on this PHP application. Any advice would help. Thanks


Solution

  • On reviewing your callstack, it's the ErrorController within your application which is throwing the error.

    I would guess it's trying to e-mail you the error details, rather than throwing the exception.

    This obviously needs to be fixed, but to see your error now try adding this into your application.ini

    resources.frontController.params.displayExceptions = 1
    phpSettings.display_startup_errors  = 1
    phpSettings.display_errors          = 1
    phpSettings.error_reporting         = "8191"
    resources.frontController.throwExceptions = true 
    

    This will throw any errors to screen, rather than trying to handle them.