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

MVC Micro Collection routing error PHP 5.6 vs 5.5

Hi there,

I use the Phalcon\Mvc\Micro\Collection, and I have a problem: the behavior differs based on (at least I guess so) the PHP version.

On my local env I have Phalcon 2.0.8 and PHP 5.5.12, and on my prod env I have also Phalcon 2.0.8 but I have PHP 5.6.

The URL is like so: /activate?c=bGlkZWxuK3Rlc3QxQGdtYW

On the prod env, I get a 404, as if the query string was being part of the URL analyzed by the router regex.

Do you have any idea what it could be about? Pending a solution, I will make my activation token part of the URL. But it is still very weird and I just hope there are not too many places where I have query string parameters.



222

Check if your htaccess or apache/nginx configurations is set up correctly to accept rewrite.

edited Apr '16

Have you tried to define your route with a trailing slash?

$clips = new MicroCollection();
$clips->setHandler('ClipsController', 0x0a); //lazy loading
$clips->setPrefix('/content');
$clips->post('/list/{num}', 'getClips', 'getClipsAlias'); //pay attention to /list/ route with a trailing slash