[SOLVED] Problem with import

Were in Yii last time any changes in import functionality? I'm running my application locally on Win and I do not ahve any problem. I've moved it to my hosinG (where linux i used) and I got following error:

YiiBase::include() [<a href='function.include'>function.include</a>]: Failed opening 'LoginForm.php' for inclusion (include_path='.:/:/usr/php/pear')

For more details please click followng address: http://beta.scrabble…aw.pl/index.php

Nope, nothing is changed regarding import.

Does it work with your testdrive application created using 'yiic webapp'?

Did you import application.components.* ?

My config file.



// uncomment the following to define a path alias


// Yii::setPathOfAlias('local','path/to/local-folder');





// This is the main Web application configuration. Any writable


// CWebApplication properties can be configured here.


return array(


	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


	'name'=>'Wrocławski Klub Scrabble Siódemka',


  'defaultController'=>'news',





	// autoloading model and component classes


	'import'=>array(


		'system.utils.*',


		'application.models.*',


		'application.components.*',


		'application.extensions.CWksHtml',    


		'application.controller.SiteController',


	),





	// application components


	'components'=>array(


		'user'=>array(


			// enable cookie-based authentication


			'allowAutoLogin'=>false,


		),


    'session'=>array(


      'autoStart'=>true 


    ),


    //authorization manager    


    'authManager'=>array(


      'class'=>'CDbAuthManager',


      'connectionID'=>'db',


    ),


	)


);


Was your application running fine before on your hosting server before?

From the error message, it seems your hosting server doesn't allow changing PHP include_path.

Application were working before (when it was a simply extended yiic webapp). I've also added blog application fot testing purpose (http://blog.scrabble.wroclaw.pl/index.php) and it seems to be working.

Could you please insert a die() statement at line 235 in YiiBase.php? You may check what is get_include_path() before and after that line.

Hi!

I've added at line 235 die() php statement. Error message doesn't change nothing were displayed. I've error:

YiiBase::include() [<a href='function.include'>function.include</a>]: Failed opening 'LoginForm.php' for inclusion (include_path='.:/:/usr/php/pear')


...


Stack Trace





#0 /framework/YiiBase.php(292): autoload()


#1 unknown(0): autoload()


#2 /protected/views/layouts/main.php(27): spl_autoload_call()


#3 /framework/web/CBaseController.php(119): require()


#4 /framework/web/CBaseController.php(88): SiteController->renderInternal()


#5 /framework/web/CController.php(593): SiteController->renderFile()


#6 /protected/controllers/SiteController.php(41): SiteController->render()


#7 /framework/web/actions/CInlineAction.php(32): SiteController->actionIndex()


#8 /framework/web/CController.php(265): CInlineAction->run()


#9 /framework/web/CController.php(243): SiteController->runAction()


#10 /framework/web/CController.php(225): SiteController->runActionWithFilters()


#11 /framework/web/CWebApplication.php(335): SiteController->run()


#12 /framework/web/CWebApplication.php(123): CWebApplication->runController()


#13 /framework/base/CApplication.php(170): CWebApplication->processRequest()


#14 /index.php(11): CWebApplication->run()


I did another test. I've commented line 292 and echoed $className.

ClassName echoed is "LoginForm" and error message was:

Fatal error: Class 'LoginForm' not found in /protected/views/layouts/main.php on line 27

When I'm echoing include paths I see only pear path.

I've also checked line 27 in main.php. It looks following:

<?php $this->widget('application.components.WksLoginWidget',array('user'=>new LoginForm())); ?>

It seems that when layout is loaded, LoginForm is still not in include path

I suspect your app config is not loaded or written correctly.

Could you insert the following line at line 765 or 779 in CApplication.php?

print_r($config); die();

Hi thx for a tip. You're right, my production config file has error and therefore it wasn't loaded correctly.