Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default #12065

Closed
vadim-job-hg opened this issue Aug 1, 2016 · 5 comments

Comments

@vadim-job-hg
Copy link

vadim-job-hg commented Aug 1, 2016

Error:

Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default in D:\OpenServer\domains\bca.loc\public\index.php:18 Stack trace: #0 [internal function]: Phalcon\Di->__construct() #1 D:\OpenServer\domains\bca.loc\public\index.php(18): Phalcon\Di\FactoryDefault->__construct() #2 D:\OpenServer\domains\bca.loc\public\index.php(92): Application->registerServices() #3 D:\OpenServer\domains\bca.loc\public\index.php(112): Application->main() #4 {main} Next Error: Access to undeclared static property: Phalcon\Di::$_default in D:\OpenServer\domains\bca.loc\public\index.php:18 Stack trace: #0 [internal function]: Phalcon\Di->__construct() #1 D:\OpenServer\domains\bca.loc\public\index.php(18): Phalcon\Di\FactoryDefault->__construct() #2 D:\OpenServer\domains\bca.loc\public\index.php(92): Application->registerServices() #3 D:\OpenServer\domains\bca.loc\public\index.php(112): Application->main() #4 {main} thrown in D:\OpenServer\domains\bca.loc\public\index.php on line 18

The error appeared after migrating from phalcon 2.1.0 RC 1 on php 5.6 to phalcon 3.0.0 on Php-7

The system: Windows 10
Server: Open Server
PhpVersion: Php-7-x64
PhalconVersion: 3.0.0

Reproduce:
Open the page, that making curl request to remote server, go to other page => got fatal error. Update page => no fatal error.

The error appeared in public/index.php

<?php


use Phalcon\Loader;
use Phalcon\Mvc\Router;
use Phalcon\DI\FactoryDefault;
use Phalcon\Mvc\Application as BaseApplication;

class Application extends BaseApplication
{


    /**
     * Register the services here to make them general or register in the ModuleDefinition to make them module-specific
     */
    protected function registerServices()
    {
        $di = new FactoryDefault(); //here is error come

        $loader = new Loader();

also see
https://forum.phalconphp.com/discussion/12453/fatal-error-in-multi-modules-app-with-php7phalcon30

@Jurigag
Copy link
Contributor

Jurigag commented Aug 1, 2016

Duplicate of #12056

@queejie
Copy link

queejie commented Jan 28, 2018

Having the same error, suddenly, after upgrading to PHP 7.2 and Phalcon 3.3.0 on Mac OS X (High Sierra).

@sergeyklay
Copy link
Contributor

@queejie Could you please open a new issue with steps/script to reproduce

@queejie
Copy link

queejie commented Jan 30, 2018

@sergeyklay Unfortunately, I cannot get it to reproduce with a known set of steps. If I reboot my computer, it fixes it for a long time (hours at least). Something eventually triggers it, after using the app, and then it happens regularly until a reboot. Oddly enough, it does not happen on every call, but when a series of AJAX calls are made to the server that use Phalcon retrieval queries. I am unable to localize it enough to be of any use, I'm afraid.

@sergeyklay
Copy link
Contributor

Well, let's use zephir-lang/zephir#1530 to track this issue. I'll plan to sort out with this in next patch releases. As workaround try to replace Apache by Nginx if it is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants