YiiBase::include(CGridColumn.php): failed to open stream: No such file or directory

I’ve got this error message during a page rendering:

YiiBase::include(CGridColumn.php) [<a href=‘yiibase.include’>yiibase.include</a>]: failed to open stream: No such file or directory

I’m using the latest Yii 1.1.1 (with yiilite + apc), and I uploaded the whole Yii package to the server, so the CGridColumn.php file exists! (another interesting thing, that CGridView is successfully used in another page in the site!)

My controller code snippet:




		$this->render('admin',array(

			'dataProvider'=>$dataProvider,

            'product'=>$product

		));



Corresponding view snippet:




<?php $this->widget('zii.widgets.grid.CGridView', array(

	'dataProvider'=>$dataProvider,

	'columns'=>array(

		'prYear',

		'prPrice',

		array(

			'class'=>'CButtonColumn',

            'template'=>'{update}&nbsp;&nbsp;&nbsp;{delete}',

		),

	),

)); ?>



What could be the problem? This part of the site used to work, and I haven’t changed anything!

the whole backtrace:

PHP Error

Description

YiiBase::include(CGridColumn.php) [<a href=‘yiibase.include’>yiibase.include</a>]: failed to open stream: No such file or directory

Source File

/home2/testbike/testwww/yii1.1/framework/yii.php(189)

00177: else

00178: self::$_aliases[$alias]=rtrim($path,’\\/’);

00179: }

00180: public static function autoload($className)

00181: {

00182: // use include so that the error PHP file may appear

00183: if(isset(self::$_coreClasses[$className]))

00184: include(YII_PATH.self::$_coreClasses[$className]);

00185: else if(isset(self::$_classes[$className]))

00186: include(self::$_classes[$className]);

00187: else

00188: {

00189: include($className.’.php’);

00190: return class_exists($className,false) || interface_exists($className,false);

00191: }

00192: return true;

00193: }

00194: public static function trace($msg,$category=‘application’)

00195: {

00196: if(YII_DEBUG)

00197: self::log($msg,CLogger::LEVEL_TRACE,$category);

00198: }

00199: public static function log($msg,$level=CLogger::LEVEL_INFO,$category=‘application’)

00200: {

00201: if(self::$_logger===null)

Stack Trace

#0 /home2/testbike/testwww/yii1.1/framework/yii.php(189): autoload()

#1 unknown(0): autoload()

#2 /home2/testbike/testwww/yii1.1/framework/yii.php(186): spl_autoload_call()

#3 /home2/testbike/testwww/yii1.1/framework/yii.php(186): autoload()

#4 unknown(0): autoload()

#5 /home2/testbike/testwww/yii1.1/framework/zii/widgets/grid/CGridView.php(279): spl_autoload_call()

#6 /home2/testbike/testwww/yii1.1/framework/zii/widgets/grid/CGridView.php(249): CGridView->createDataColumn()

#7 /home2/testbike/testwww/yii1.1/framework/zii/widgets/grid/CGridView.php(235): CGridView->initColumns()

#8 /home2/testbike/testwww/yii1.1/framework/yii.php(2768): CGridView->init()

#9 /home2/testbike/testwww/yii1.1/framework/yii.php(2773): ProductEntityController->createWidget()

#10 /home2/testbike/testwww/protected/admin/views/productEntity/admin.php(26): ProductEntityController->widget()

#11 /home2/testbike/testwww/yii1.1/framework/yii.php(2751): require()

#12 /home2/testbike/testwww/yii1.1/framework/yii.php(2730): ProductEntityController->renderInternal()

#13 /home2/testbike/testwww/yii1.1/framework/yii.php(3107): ProductEntityController->renderFile()

#14 /home2/testbike/testwww/yii1.1/framework/yii.php(3084): ProductEntityController->renderPartial()

#15 /home2/testbike/testwww/protected/admin/controllers/ProductEntityController.php(325): ProductEntityController->render()

#16 /home2/testbike/testwww/yii1.1/framework/yii.php(3299): ProductEntityController->actionAdmin()

#17 /home2/testbike/testwww/yii1.1/framework/yii.php(2899): CInlineAction->run()

#18 /home2/testbike/testwww/yii1.1/framework/yii.php(5270): ProductEntityController->runAction()

#19 /home2/testbike/testwww/yii1.1/framework/yii.php(5279): CFilterChain->run()

#20 /home2/testbike/testwww/protected/components/Controller.php(14): AccessControlFilter->filter()

#21 /home2/testbike/testwww/yii1.1/framework/yii.php(5309): ProductEntityController->filterAccessControl()

#22 /home2/testbike/testwww/yii1.1/framework/yii.php(5267): CInlineFilter->filter()

#23 /home2/testbike/testwww/yii1.1/framework/yii.php(2889): CFilterChain->run()

#24 /home2/testbike/testwww/yii1.1/framework/yii.php(2874): ProductEntityController->runActionWithFilters()

#25 /home2/testbike/testwww/yii1.1/framework/yii.php(1497): ProductEntityController->run()

#26 /home2/testbike/testwww/yii1.1/framework/yii.php(1392): CWebApplication->runController()

#27 /home2/testbike/testwww/yii1.1/framework/yii.php(1007): CWebApplication->processRequest()

#28 /home2/testbike/testwww/admin.php(14): CWebApplication->run()

I’m having the same exact issue but with a zii widget:

http://www.yiiframework.com/forum/index.php?/topic/8229-zii-widget-issue/page__hl__autoload__fromsearch__1

I had the same problem, then I remove APC.so from php.ini

After that it works fine. I dunno what the reason behind this… Haha…

I had this problem and determined it was caused not by a missing file, but by a corrupt class signature. In other words, I had a controller class with the filename "CoolController.php". But due to a copy/paste error, its class signature was:




class LameController extends Controller {

    ...

}



Once I fixed the class signature to read:




class CoolController extends Controller {

    ...

}



…I was good to go.

Cheers

Hi KipKapKup,

thanks for that hint. I had the same problem (with Command.php class) which suddenly appear. After removing apc.ini from php5 configuration and restart apache, it worked!!!

Maybe some apc cache-empty or even only an Apache restart would also be enough, I couldn’t reproduce the solution, but at the end it worked :slight_smile:

Thanks

Achim

Try enabling apc.stat so you can keep APC enabled. That may help you.