Yii Framework Forum: Yii 2 - Call_User_Func Warrning - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii 2 - Call_User_Func Warrning Rate Topic: -----

#1 User is offline   mm_11111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-January 12
  • Location:Warsaw

Posted 17 May 2014 - 08:21 AM

When I try run app on linux server with php version: 5.4.23 I have a warrning:
"call_user_func() expects parameter 1 to be a valid callback, no array or string given"
and my app doesn't work

On windows and php v 5.4.22 it works correct

Any suggestion ?
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 480
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 17 May 2014 - 09:27 AM

what code are you referring to? Please post the code or say which file and line of the framework you refer to.
0

#3 User is offline   mm_11111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-January 12
  • Location:Warsaw

Posted 17 May 2014 - 09:41 AM

View PostCeBe, on 17 May 2014 - 09:27 AM, said:

what code are you referring to? Please post the code or say which file and line of the framework you refer to.

1. in vendor/yiisoft/yii2/base/Component.php at line 546
537538539540541542543544545546547548549550551552553554555

                $event = new Event;
            }
            if ($event->sender === null) {
                $event->sender = $this;
            }
            $event->handled = false;
            $event->name = $name;
            foreach ($this->_events[$name] as $handler) {
                $event->data = $handler[1];
                call_user_func($handler[0], $event);
                // stop further handling if the event is handled
                if ($event->handled) {
                    return;
                }
            }
        }
        // invoke class-level attached handlers
        Event::trigger($this, $name, $event);
    }


0

#4 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 480
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 17 May 2014 - 10:42 AM

so this looks like you regsistered an invalid event handler.
0

#5 User is offline   mm_11111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-January 12
  • Location:Warsaw

Posted 17 May 2014 - 12:16 PM

View PostCeBe, on 17 May 2014 - 10:42 AM, said:

so this looks like you regsistered an invalid event handler.


I din't register any own event. In stack trace I see:

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'call_user_func(...', '/home/th175382/...', 546, Array)
#1 vendor/yiisoft/yii2/base/Component.php(546): call_user_func(NULL, Object(yii\base\Event))
#2 vendor/yiisoft/yii2/base/Application.php(350): yii\base\Component->trigger('beforeRequest')


I don't understand why it's work on my local machine, a don't on the remote :(
0

#6 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 480
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 18 May 2014 - 04:23 AM

There must be something that registered an handler to the beforeRequest event. If it was not yourself it may be some extension or an application behavior.

Can you show your composer.json file and the application config?
0

#7 User is offline   mm_11111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-January 12
  • Location:Warsaw

Posted 18 May 2014 - 06:49 AM

View PostCeBe, on 18 May 2014 - 04:23 AM, said:

There must be something that registered an handler to the beforeRequest event. If it was not yourself it may be some extension or an application behavior.

Can you show your composer.json file and the application config?


Yes, composer is stndard yii advance template
{
	"name": "yiisoft/yii2-app-advanced",
	"description": "Yii 2 Advanced Application Template",
	"keywords": ["yii2", "framework", "advanced", "application template"],
	"homepage": "http://www.yiiframework.com/",
	"type": "project",
	"license": "BSD-3-Clause",
	"support": {
		"issues": "https://github.com/yiisoft/yii2/issues?state=open",
		"forum": "http://www.yiiframework.com/forum/",
		"wiki": "http://www.yiiframework.com/wiki/",
		"irc": "irc://irc.freenode.net/yii",
		"source": "https://github.com/yiisoft/yii2"
	},
	"minimum-stability": "beta",
	"require": {
		"php": ">=5.4.0",
		"yiisoft/yii2": "*",
		"yiisoft/yii2-bootstrap": "*",
		"yiisoft/yii2-swiftmailer": "*"
	},
	"require-dev": {
		"yiisoft/yii2-codeception": "*",
		"yiisoft/yii2-debug": "*",
		"yiisoft/yii2-gii": "*"
	},
	"suggest": {
		"codeception/codeception": "Codeception, 1.8.*@dev is currently works well with Yii.",
		"codeception/specify": "BDD style code blocks for PHPUnit and Codeception",
		"codeception/verify": "BDD Assertions for PHPUnit and Codeception",
		"yiisoft/yii2-faker": "Fixtures generator for Yii2 based on Faker lib"
	},
	"scripts": {
		"post-create-project-cmd": [
			"yii\\composer\\Installer::setPermission"
		]
	},
	"config": {
		"process-timeout": 1800
	},
	"extra": {
		"writable": [
			"backend/runtime",
			"backend/web/assets",

			"console/runtime",
			"console/migrations",

			"frontend/runtime",
			"frontend/web/assets"
		]
	}
}


Config main:
<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-admin',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'admin\controllers',
    'language' => 'pl-PL', // ← here!
    'bootstrap' => ['log'],
    'modules' => [],
    'components' => [
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
    ],
    'params' => $params,
];


config main-local
<?php

$config = [];

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';
    $config['modules']['gii'] = 'yii\gii\Module';
}

return $config;

0

#8 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 480
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 18 May 2014 - 06:52 AM

does the problem also exist with a fresh install of the advanced app without any changes?
0

#9 User is offline   mm_11111 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 13-January 12
  • Location:Warsaw

Posted 18 May 2014 - 07:57 AM

View PostCeBe, on 18 May 2014 - 06:52 AM, said:

does the problem also exist with a fresh install of the advanced app without any changes?


yes I install fresh php
composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced /path/to/yii-application
and it's the same error.

I use composer on my local machine and then move files via ftp, does it matter ? I should use composer on remote server ? (I don't permission to console )

In Yii requirements I have:
PDO SQLite extension - warning
Memcache extension - warning
APC extension - warning
Expose PHP - warning

ON localhost:
I have only APC extension - warning

Can it be the reason ?
0

#10 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 480
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 18 May 2014 - 08:27 AM

No idea what is going wrong here. Seen that there is a similar issue report on github. Please provide more information(Operating system and exact version) in that issue: https://github.com/y...ii2/issues/1988
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users