We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon Tutorial 3 not working

Hi There,

Am relatively new to Phalcon and decided to try this as it got good reviews and would like to learn this and use this. But I am stuck with this error:

Fatal error: Uncaught exception 'Phalcon\Mvc\Micro\Exception' with message 'The Not-Found handler is not callable or is not defined

I was following the same codes as to the tutorial 3 (https://docs.phalcon.io/en/latest/reference/tutorial-rest.html), except that instead of robots, I used students out of curiosity. I have been searching the web, tried some noted solutions there but it did not work for me. To see the actual code, just see the tutorials and replace robots with students, that's it.

What am I missing here? I really want to learn this one and use it whenever I will create API in the future as I see great potential with it.

Thanks a lot, icewing02



98.9k

It means you need to implement a not-found handler. This handler is responsible for handling the requests when a URI that was not set up before was passed.

Check this https://docs.phalcon.io/en/latest/reference/micro.html#not-found-handler



9.5k
edited Jul '14

Thanks for the prompt reply!

Yes, I already have that one and I get the idea that I can create customized error handling with it. But more importantly, it is still not working. What am I missing here to make it actually work?

Just an update, aside from robots changed to students, I also only used the routing for getting the list of students, no insert, search, update or delete, just get the list thereof. Of course, including the database credentials but it seems the error is not about it.



98.9k

Could you please post your code in a Github repo?



9.5k
edited Jul '14

Sure thing... you can check it here: https://github.com/icewing02/debug-phalcon

Thanks in advance!



98.9k
Accepted
answer
edited Jul '14

It's working for me, when I access:



9.5k
Accepted
answer

Thanks for the reply. It is now working! I get the issue on my end now. It is because I placed it inside a folder named "api" and thought that it would link through with it. It turns out that I need to add another "api" on the URI in order for it to be accessed. Alternatively, it could also be done by changing the rerouting and it should work out fine.

Am really greatful, thanks. Will continue studying on creating APIs.

Jay,