Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:44:15+00:00 2026-06-07T04:44:15+00:00

I am new to zendframework. Now i am facing problem with error reporting; when

  • 0

I am new to zendframework. Now i am facing problem with error reporting; when i makes small mistakes it’s show me a long error message like this

 Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /var/www/html/workbench/zend/library/Zend/Controller/Dispatcher/Standard.php:248 Stack trace: #0 /var/www/html/workbench/lajeesh/zend/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/html/workbench/lajeesh/zend/library/Zend/Controller/Front.php(212): Zend_Controller_Front->dispatch() #2 /var/www/html/workbench/sudeepc/zend/web_root/index.php(10): Zend_Controller_Front::run('../application/...') #3 {main} Next exception 'Zend_Controller_Exception' with message 'Invalid controller specified (error)#0 /var/www/html/workbench/lajeesh/zend/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/html/workbench/lajeesh/zend/library/Zend/Controller/Front.ph in /var/www/html/workbench/lajeesh/zend/library/Zend/Controller/Plugin/Broker.php on line 336 

and so on…. . so my question is how can i configure zend framework error reporting more user friendly ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:44:17+00:00Added an answer on June 7, 2026 at 4:44 am

    Error management is done in the following files..you can customize the way you want
    1.ErrorController
    2.error/error.phtml

    ErrorController.php

    <?php
    
    class ErrorController extends Zend_Controller_Action
    {
    
            public function init()
            {
                $this->_helper->layout->setLayout('set your default layout here'); //so it will be much more nicer
            }
    
        public function errorAction()
        {
            $errors = $this->_getParam('error_handler');
    
            if (!$errors) {
                $this->view->message = 'You have reached the error page';
                return;
            }
    
            switch ($errors->type) {
                case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
                case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
                case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
    
                    // 404 error -- controller or action not found
                    $this->getResponse()->setHttpResponseCode(404);
                    $this->view->message = PackAssist_Locale::translate('Sorry, the page doesnt exists'); //This is a custom message
                    break;
                default:
                    // application error
                    $this->getResponse()->setHttpResponseCode(500);
                    $this->view->message = 'Application error'; // put any custom messages if you want
                    break;
            }
    
            // Log exception, if logger available
            if ($log = $this->getLog()) {
                $log->crit($this->view->message, $errors->exception);
            }
    
            // conditionally display exceptions
            if ($this->getInvokeArg('displayExceptions') == true) {
                $this->view->exception = $errors->exception;
            }
    
            $this->view->request   = $errors->request;
        }
    
        public function getLog()
        {
            $bootstrap = $this->getInvokeArg('bootstrap');
            if (!$bootstrap->hasResource('Log')) {
                return false;
            }
            $log = $bootstrap->getResource('Log');
            return $log;
        }
    
    
    }
    

    error.phtml

    <div>
      <h1><?php echo $this->translate('An error occurred');?></h1>
      <h2><?php echo $this->message; //Base error message ?></h2>
    
      <?php if (isset($this->exception)): ?>
    
      <h3><?php echo $this->translate('Exception information');?>:</h3>
      <p>
          <b>Message:</b> <?php echo $this->exception->getMessage(); ?>
      </p>
    
      <h3>Stack trace:</h3>
      <pre><?php  echo $this->exception->getTraceAsString(); //You can hide this for the end user ?>
      </pre>
    
      <h3>Request Parameters:</h3>
      <pre><?php  echo var_export($this->request->getParams(), true); // This will bea an array of your requested params POST/GET variables,your controller and the current action that produced the error ?>
      </pre>
    

    3.If you want to completely hide the errors.just put these lines in your config file

    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create a complete pluggin in Wordpress using ZendFramework and now i'd like to
I'm new to Zend Framework. I would like to know how to implement zend
I feel my problem is relatively simple. I'm new to the Zend framework and
New to PHP and MySQL, have heard amazing things about this website from Leo
I have recently setup XAMPP 1.7.3 and ZendFramework 1.10.4 on a new computer and
I am new to zend framework. I have write this code to set cookie
I have reedited the question to show where was the problem. Hi, I'm building
This is the third time I'm installing zend studio and zend server now these
I'm fairly new with creating a web application and would like to seek help
Help/support application built with Zend Framework 1 and Doctrine 1.2.4. Problem: when creating new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.