[Sat Jul 14 12:38:35.506203 2012] [:error] [pid 2300:tid 139876527757056] [client 192.168.0.111:51405] PHP Fatal error: Uncaught exception ‘LogicException’ with message ‘Passed array does not specify an existing static method (class ‘YiiBase’ does not have a method ‘autoload’)’ in /usr/local/apache2/htdocs/yii-1.1.8.r3324/framework/YiiBase.php:849\nStack trace:\n#0 /usr/local/apache2/htdocs/yii-1.1.8.r3324/framework/YiiBase.php(849): spl_autoload_register(Array)\n#1 /usr/local/apache2/htdocs/yii-1.1.8.r3324/framework/yii.php(14): require(’/usr/local/apac…’)\n#2 /usr/local/apache2/htdocs/practise/demo/index.php(12): require_once(’/usr/local/apac…’)\n#3 {main}\n thrown in /usr/local/apache2/htdocs/yii-1.1.8.r3324/framework/YiiBase.php on line 849, referer:
My server environment:
Centos 6.2 X64 minimum with application developement yum package
Apache 2.4 , PHP 5.4, both manaual installation. And the Apache and php are working well as I have checked with simple php script.
Also, I have checked the YiiBass.php , it does have the public static autoload function.
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../yii-1.1.8.r3324/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();
Since I’ve not started to develope applications, Namespace issue seems unlikely the cause. And, Line 849 does have codes you mentioned above. Anyway, I’m deciding downgrading PHP 5.4.3 to PHP 5.3.14. Let’see if the problem is still there
hey, yugene, it looks like the issue is caused by PHP version 5.4.3. Although the root cause is still unknown ( I guess it has something to do with parser), the demo app is working well under the combination of Apache 2.4 and PHP 5.3.14.
Hope this thread helps those setting up yii framework in a server environment such as CentOs 6.2 X86-64, Apache 2.4
I had the same problem, And it started as i installed APC on my server, since I needed APC methods removing
it from the server was not an option, So instead i disabled the php cache part, and yet the methods were available.
In order to disable the php caching all you have to do is adding the following code to your php.ini, (or changing it if it exists, It may also be on apc.ini for linux base servers)
[apc]
apc.enabled = 0
Here you can see the full apc runtime configuration