newb question

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

newb question

Piotr Barszczewski
Hi. I'm new to writing on top of the Zend Framework, and while i was
doing the basic almost-like-from-the-manual stuff like the bootstrap
file and the basic controller i ran into a situation where router
couldn't find the index action in index controller. It does load the
IndexController class, but it always performs noRoute method - even when
i specify the controller/action part of the uri. It's the same for any
other controller, eg. DummyController, etc.
I did rewrite everything to be just like in the documentation, but it's
the same every time :/ and i don't have an idea what did i do wrong. I'm
on wXp / Apache 1.3.3 / PHP 5.1.4. Does anyone have any suggestions? I'd
like to get into ZF, but i've 'hit the wall' just on the start.
Besides, I'm think it would be a good idea to launch a forum for people
who feel confused a little bit, and would like to ask questions, but not
necessarily on the mailing list, which is a little to search :)
Take care,
Piotr Barszczewski
Reply | Threaded
Open this post in threaded view
|

Re: newb question

Thomas Weidner
Hy Piotr,

> i ran into a situation where router
> couldn't find the index action in index controller.

When getting in trouble try this script:
http://www.sitepoint.com/blogs/2006/04/04/pretty-blue-screen/

It should help to find the error.

Greets
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: newb question

Steven Van Poeck
In reply to this post by Piotr Barszczewski
Quoting Piotr Barszczewski <[hidden email]>:

> Hi. I'm new to writing on top of the Zend Framework, and while i was
> doing the basic almost-like-from-the-manual stuff like the bootstrap
> file and the basic controller i ran into a situation where router
> couldn't find the index action in index controller. It does load the
> IndexController class, but it always performs noRoute method - even when
> i specify the controller/action part of the uri. It's the same for any
> other controller, eg. DummyController, etc.
> I did rewrite everything to be just like in the documentation, but it's
> the same every time :/ and i don't have an idea what did i do wrong. I'm
> on wXp / Apache 1.3.3 / PHP 5.1.4. Does anyone have any suggestions? I'd
> like to get into ZF, but i've 'hit the wall' just on the start.

Hello Piotr,

If your app is not in the root directory, you'll get this behaviour. In that
case, please check
http://www.akrabat.com/2006/03/15/zend-framework-router-again/

If your installation is *not* in a subdirectory, let us know :)

> Besides, I'm think it would be a good idea to launch a forum for people
> who feel confused a little bit, and would like to ask questions, but not
> necessarily on the mailing list, which is a little to search :)

For several reasons, explained at
http://www.zend.com/lists/fw-general/200603/msg00454.html and at
http://www.zend.com/lists/fw-general/200605/msg00188.html, we do not have a
support forum (yet).

> Take care,
> Piotr Barszczewski
>

Best regards,
Steven Van Poeck
http://poekie.free.fr
Reply | Threaded
Open this post in threaded view
|

Re: newb question

Piotr Barszczewski
Steven Van Poeck napisał(a):

> Quoting Piotr Barszczewski <[hidden email]>:
>
>> Hi. I'm new to writing on top of the Zend Framework, and while i was
>> doing the basic almost-like-from-the-manual stuff like the bootstrap
>> file and the basic controller i ran into a situation where router
>> couldn't find the index action in index controller. It does load the
>> IndexController class, but it always performs noRoute method - even when
>> i specify the controller/action part of the uri. It's the same for any
>> other controller, eg. DummyController, etc.
>> I did rewrite everything to be just like in the documentation, but it's
>> the same every time :/ and i don't have an idea what did i do wrong. I'm
>> on wXp / Apache 1.3.3 / PHP 5.1.4. Does anyone have any suggestions? I'd
>> like to get into ZF, but i've 'hit the wall' just on the start.
>
> Hello Piotr,
>
> If your app is not in the root directory, you'll get this behaviour.
> In that
> case, please check
> http://www.akrabat.com/2006/03/15/zend-framework-router-again/
>
You know, i just intalled the framework, and I have no idea on how to
run a custom router :) But i'll check it when (if) i make it all working
somehow
In my basic/default situation I have it like this:
The first instalation
    http://localhost/zfTest1/dev/document_root
or
    http://localhost/zfTest1/dev/  with .htaccess in dev dir, so it
forwards all requests to document_root/index.php

and a second instalation under
    http://localhost/zfTest/document_root
or
    http://localhost/zfTest1/

None of these have worked. It does call noRoute method, and when i put
Zend::dump( $this ); in it i get loads of stuff, and this

     ["error"] => object(Zend_Controller_Router_Exception)#6 (6) {
        ["message:protected"] => string(39) "Request could not be mapped
to a route."


The most confusing thing is that it has already found the path to this
controller, but it doesn't see the indexAction() method, and calls
noRoute from the same file.
I checked it on my 2nd cpu with apache, ant i had the same results (i'd
put it all in the root dir - localhost/zfTest/ )
Take care,
Piotr Barszczewski

> If your installation is *not* in a subdirectory, let us know :)
>
>> Besides, I'm think it would be a good idea to launch a forum for people
>> who feel confused a little bit, and would like to ask questions, but not
>> necessarily on the mailing list, which is a little to search :)
lol, little == easy :) don't know why i wrote it :)

>
> For several reasons, explained at
> http://www.zend.com/lists/fw-general/200603/msg00454.html and at
> http://www.zend.com/lists/fw-general/200605/msg00188.html, we do not
> have a
> support forum (yet).
>
>> Take care,
>> Piotr Barszczewski
>>
>
> Best regards,
> Steven Van Poeck
> http://poekie.free.fr
>
>


Reply | Threaded
Open this post in threaded view
|

Re: newb question

Piotr Barszczewski
In reply to this post by Thomas Weidner
Thomas Weidner napisał(a):

> Hy Piotr,
>
>> i ran into a situation where router
>> couldn't find the index action in index controller.
>
> When getting in trouble try this script:
> http://www.sitepoint.com/blogs/2006/04/04/pretty-blue-screen/
>
> It should help to find the error.
>
> Greets
> Thomas
>
>
Hello Thomas
Thanks for the script (it seems to rock!), but it didn't catch anything
(or i don't understand something from the usage instructions :) ). Btw,
it made apache process crash when i did something like
    require_once 'PrettyBlueScreen.php';
    require_once 'Zend/Controller/Front.php';
    Zend_Controller_Front::run( dirname( __FILE__ ) .
'/../app...lication/controllers/' );

When I comment out the PrettyBlueScreen require, i get an
Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message
'Directory "...
as i expected. Dunno, nothing seems to work for me today ;)
Take care,
Piotr Barszczewski


Reply | Threaded
Open this post in threaded view
|

Re: newb question

Steven Van Poeck
In reply to this post by Piotr Barszczewski
Piotr Barszczewski a écrit :

> Steven Van Poeck napisał(a):
>> Quoting Piotr Barszczewski <[hidden email]>:
>>
>>> Hi. I'm new to writing on top of the Zend Framework, and while i was
>>> doing the basic almost-like-from-the-manual stuff like the bootstrap
>>> file and the basic controller i ran into a situation where router
>>> couldn't find the index action in index controller. It does load the
>>> IndexController class, but it always performs noRoute method - even when
>>> i specify the controller/action part of the uri. It's the same for any
>>> other controller, eg. DummyController, etc.
>>> I did rewrite everything to be just like in the documentation, but it's
>>> the same every time :/ and i don't have an idea what did i do wrong. I'm
>>> on wXp / Apache 1.3.3 / PHP 5.1.4. Does anyone have any suggestions? I'd
>>> like to get into ZF, but i've 'hit the wall' just on the start.
>> Hello Piotr,
>>
>> If your app is not in the root directory, you'll get this behaviour.
>> In that
>> case, please check
>> http://www.akrabat.com/2006/03/15/zend-framework-router-again/
>>
> You know, i just intalled the framework, and I have no idea on how to
> run a custom router :) But i'll check it when (if) i make it all working
> somehow
> In my basic/default situation I have it like this:
> The first instalation
>     http://localhost/zfTest1/dev/document_root
> or
>     http://localhost/zfTest1/dev/  with .htaccess in dev dir, so it
> forwards all requests to document_root/index.php
>
> and a second instalation under
>     http://localhost/zfTest/document_root
> or
>     http://localhost/zfTest1/
>
> None of these have worked. It does call noRoute method, and when i put
> Zend::dump( $this ); in it i get loads of stuff, and this
>
>      ["error"] => object(Zend_Controller_Router_Exception)#6 (6) {
>         ["message:protected"] => string(39) "Request could not be mapped
> to a route."
>

Ok so you did not install the framework under the root directory of your
web server. Two options:
1. Install the lot directly under http://localhost
2. Read Rob Allen's (aka Akrabat) post on his blog regarding this. I
gave you the URL

>
> The most confusing thing is that it has already found the path to this
> controller, but it doesn't see the indexAction() method, and calls
> noRoute from the same file.
> I checked it on my 2nd cpu with apache, ant i had the same results (i'd
> put it all in the root dir - localhost/zfTest/ )
> Take care,
> Piotr Barszczewski
>
>> If your installation is *not* in a subdirectory, let us know :)
>>
>>> Besides, I'm think it would be a good idea to launch a forum for people
>>> who feel confused a little bit, and would like to ask questions, but not
>>> necessarily on the mailing list, which is a little to search :)
> lol, little == easy :) don't know why i wrote it :)

You can search the mailing list at Richard Thomas' website:
http://www.cyberlot.net/demos/ZF_Search/

Good luck in setting it all up :)

Steven

>> For several reasons, explained at
>> http://www.zend.com/lists/fw-general/200603/msg00454.html and at
>> http://www.zend.com/lists/fw-general/200605/msg00188.html, we do not
>> have a
>> support forum (yet).
>>
>>> Take care,
>>> Piotr Barszczewski
>>>
>> Best regards,
>> Steven Van Poeck
>> http://poekie.free.fr
>>
>>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: newb question

Piotr Barszczewski
Steven Van Poeck napisał(a):

> Piotr Barszczewski a écrit :
>> Steven Van Poeck napisał(a):
>>> Quoting Piotr Barszczewski <[hidden email]>:
>>>
>>>> Hi. I'm new to writing on top of the Zend Framework, and while i was
>>>> doing the basic almost-like-from-the-manual stuff like the bootstrap
>>>> file and the basic controller i ran into a situation where router
>>>> couldn't find the index action in index controller. It does load the
>>>> IndexController class, but it always performs noRoute method - even
>>>> when
>>>> i specify the controller/action part of the uri. It's the same for any
>>>> other controller, eg. DummyController, etc.
>>>> I did rewrite everything to be just like in the documentation, but
>>>> it's
>>>> the same every time :/ and i don't have an idea what did i do
>>>> wrong. I'm
>>>> on wXp / Apache 1.3.3 / PHP 5.1.4. Does anyone have any
>>>> suggestions? I'd
>>>> like to get into ZF, but i've 'hit the wall' just on the start.
>>> Hello Piotr,
>>>
>>> If your app is not in the root directory, you'll get this behaviour.
>>> In that
>>> case, please check
>>> http://www.akrabat.com/2006/03/15/zend-framework-router-again/
>>>
>> You know, i just intalled the framework, and I have no idea on how to
>> run a custom router :) But i'll check it when (if) i make it all working
>> somehow
>> In my basic/default situation I have it like this:
>> The first instalation
>>     http://localhost/zfTest1/dev/document_root
>> or
>>     http://localhost/zfTest1/dev/  with .htaccess in dev dir, so it
>> forwards all requests to document_root/index.php
>>
>> and a second instalation under
>>     http://localhost/zfTest/document_root
>> or
>>     http://localhost/zfTest1/
>>
>> None of these have worked. It does call noRoute method, and when i put
>> Zend::dump( $this ); in it i get loads of stuff, and this
>>
>>      ["error"] => object(Zend_Controller_Router_Exception)#6 (6) {
>>         ["message:protected"] => string(39) "Request could not be mapped
>> to a route."
>>
>
> Ok so you did not install the framework under the root directory of
> your web server. Two options:
> 1. Install the lot directly under http://localhost
> 2. Read Rob Allen's (aka Akrabat) post on his blog regarding this. I
> gave you the URL
>
>>
>> The most confusing thing is that it has already found the path to this
>> controller, but it doesn't see the indexAction() method, and calls
>> noRoute from the same file.
>> I checked it on my 2nd cpu with apache, ant i had the same results (i'd
>> put it all in the root dir - localhost/zfTest/ )
>> Take care,
>> Piotr Barszczewski
>>
>>> If your installation is *not* in a subdirectory, let us know :)
>>>
>>>> Besides, I'm think it would be a good idea to launch a forum for
>>>> people
>>>> who feel confused a little bit, and would like to ask questions,
>>>> but not
>>>> necessarily on the mailing list, which is a little to search :)
>> lol, little == easy :) don't know why i wrote it :)
>
> You can search the mailing list at Richard Thomas' website:
> http://www.cyberlot.net/demos/ZF_Search/
>
> Good luck in setting it all up :)
>
Thanks! I've added a virtual host and it works just fine! I'd never
suppose thet this could be the problem. But is it going to be changed in
the future? What if I'd want to install the app in a subdir just to set
things up before i put it in the root dir, and i cant add another
virtual host?

Piotrek

> Steven
>
>>> For several reasons, explained at
>>> http://www.zend.com/lists/fw-general/200603/msg00454.html and at
>>> http://www.zend.com/lists/fw-general/200605/msg00188.html, we do not
>>> have a
>>> support forum (yet).
>>>
>>>> Take care,
>>>> Piotr Barszczewski
>>>>
>>> Best regards,
>>> Steven Van Poeck
>>> http://poekie.free.fr
>>>
>>>
>>
>>
>>
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: newb question

akrabat
Piotr Barszczewski wrote:

> Thanks! I've added a virtual host and it works just fine! I'd never
> suppose thet this could be the problem. But is it going to be changed in
> the future? What if I'd want to install the app in a subdir just to set
> things up before i put it in the root dir, and i cant add another
> virtual host?

With the current release you have a few choices:
1. Patch your copy of Zend_Controller_Router
2. Use your own router, such as Akrabat_Controller_Router
3. Wait for the new router that's coming :)

Regards,

Rob...