We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Phalcon Dependency Injection[Solved]

Hello, im just getting started on MVC and chose Phalcon to learn about it, i have configured my server for phalcon,

php-fpm 5.5 nginx 1.4.5 Phalcon 1.2.6

I can create a project correctly with commands, at first i could not load the IndexController, but i changed the paths of the config since they were incorrect, now i get this message

"A dependency injection object is required to access internal services"

i have read a few post on the forum and recompiled for 64bit, bit that did not work, i have also added "var_export($di); on my index.php but it prints $di as NULL

I will appreciate any help on this.

Without seeing more code it's tough to tell exactly what the problem is. Your error is in the code you've written though, not in Phalcon or in a mistake you made in installing it - so that narrows it down.

That error probably has a line number and filename associated with it.

My wild guess is your bootstrap file is trying to initialize something, but you're not passing the dependency injector object as a parameter.


Found the issue, i downloaded the Invo example and had the same issue, reading about it, gave write permissions to the cache folder, and that fixed it, thanks