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

Controller handler class cannot be loaded en Phalcon 4

I created a project using the development tools named rema. When I enter the index

https://localhost/rema/

I get the error message

RemaController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->throwDispatchException('RemaController ...', 2)
#1 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#2 C:\xampp\htdocs\rema\public\index.php(43): Phalcon\Mvc\Application->handle('/rema/')
#3 {main}

But rema is the name of the project not a controller. In the version of Phalcon 3 I did not have this message. How can i correct it?

In v4, there were changes related to sub-directory detection. In index.php, you need to change value inside handle() method.



81.1k

THIS IS MY FILE <?php $router = $di->getRouter(); // Define your routes here $router->handle($_SERVER['REQUEST_URI']);



81.1k

THIS IS MY FILE



8.4k
Accepted
answer

your issue is because your phalcon project is not on root folder

you can find the solution here