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\Di::$_default

Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default in E:\datacentre\app\config\services.php:42 Stack trace:

0 [internal function]: Phalcon\Di->__construct()

1 E:\datacentre\app\config\services.php(42): Phalcon\Di\FactoryDefault->__construct()

2 E:\datacentre\public\index.php(52): require('E:\datacentre\a...')

3 {main}

Next Error: Access to undeclared static property: Phalcon\Di::$_default in E:\datacentre\app\config\services.php on line

8 use Phalcon\DI\FactoryDefault; ..... 42 $di = new FactoryDefault();



145.0k
Accepted
answer
edited Sep '16

This is known problem with windows and apache2 php module only/iis + php module. You can solve it by using:

  • nginx + php-cgi + windows
  • apache + php-cgi + windows
  • iis + php-cgi + windows
  • docker to use linux
  • vagrant to use linux

Of course in future phalcon team will need to fix this issue.



27.0k

nginx+php-fpm+linux(centos) can solve this?

As i posted above if you want to keep phalcon and windows nginx + php-cgi can work too.