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

Micro does not work with Phalcon Dev 3.4.0

Hello Gents,

I hope youre doing well. I'm trying to create my first micro rest api (I have some experience with Simple and Modular). I used Phalcon Dev 3.4.0 and created the default folder structure. It's working the $app->get('/', with their 'index' view, but any other route doesnt work. IF someone has same behavior?

Thanks Pablo

It's most likely about your nginx/apache configuration like url rewriting and passing it into phalcon.



940

It's not. Just using default .htaccess file.

It's most likely about your nginx/apache configuration like url rewriting and passing it into phalcon.

What you mean by default .htaccess file?

3.4.0 dev?! You mean dev branch? Well, 3.4.0 is official release.

I do use Micro with it - and it does work for sure. You must set your web server correctly.

edited Jul '18

but any other route doesnt work

And what exactly does that mean? Do you get an Exception from PHP? Do you get a 5xx webserver error page? Do you get a 4xx error page? Does your computer blow up and bunnies start crying?

It's not. Just using default .htaccess file.

Maybe that's your problem. In order for phalcon to properly serve the URL, you have to redirect all not-found URLs to index.php. Afaik, apache does not have rewrite rules by default.

info for apache:

https://olddocs.phalcon.io/en/latest/reference/apache.html

info for nginx:

https://olddocs.phalcon.io/en/latest/reference/nginx.html