|
With ZF2 beta 5 I keep getting a 404 error when going through the
Quickstart guide. I'm sure I'm missing something somewhere, but how do I go about troubleshooting a route? How can I see what routes have been loaded, and what controllers it's looking for? Cheers, David |
|
This post has NOT been accepted by the mailing list yet.
Is your .htaccess mod_rewrite rule working?
On Jul 10, 2012, at 3:51 PM, David Muir-2 [via Zend Framework Community] wrote: With ZF2 beta 5 I keep getting a 404 error when going through the |
|
In reply to this post by David Muir-2
David,
You'll want to see what's happening in the RouteListener: https://github.com/zendframework/zf2/blob/master/library/Zend/Mvc/RouteListener.php#L69 If the route match isn't correct, dig in to the Router, however if the route match is correct, take a look at the DispatchListener: https://github.com/zendframework/zf2/blob/master/library/Zend/Mvc/DispatchListener.php#L91 A controller not found can also cause a 404 and a number of things could cause a controller to not be found, like an error fulfilling a dependency. Hope that helps, -Nick (@SocalNick)
On Tue, Jul 10, 2012 at 3:50 PM, David Muir <[hidden email]> wrote: With ZF2 beta 5 I keep getting a 404 error when going through the Quickstart guide. I'm sure I'm missing something somewhere, but how do I go about troubleshooting a route? How can I see what routes have been loaded, and what controllers it's looking for? |
|
Thanks. In my case I'm pretty sure it's
a configuration problem with the controllers, but haven't been
able to pinpoint it yet.
So in the case of a routing error, would I attach an handler to the MvcEvent::EVENT_DISPATCH_ERROR event to be able to inspect it, and similarly with the DispatchListener? Cheers, David On 12/07/12 02:12, Nicholas Calugar wrote: David, |
|
Honestly, I use ZendDebugger in ZendStudio when I run into these issues. Easiest way to determine what is failing. Without such a tool you may have to resort to ghetto debugging, aka var_dump. Slightly less ghetto: \Zend\Debug::dump($somevar);
-Nick On Wed, Jul 11, 2012 at 4:44 PM, David Muir <[hidden email]> wrote:
|
|
I'm too used to ghetto debugging :-) I
do sometimes use XDebug though.
Got everything working. Turns out I was missing routes for my specific module. Oops. Misread the config for application thinking that it had a global route that worked with modules. When reading it again, I realised it's only a route for /my-app/application/<controller>/<action>. Seems like ZendSkeletonModule had a few bugs too, but that might have been fixed in the past couple of days. David On 12/07/12 10:17, Nicholas Calugar wrote: Honestly, I use ZendDebugger in ZendStudio when I run into these issues. Easiest way to determine what is failing. Without such a tool you may have to resort to ghetto debugging, aka var_dump. Slightly less ghetto: \Zend\Debug::dump($somevar); |
| Powered by Nabble | Edit this page |
