Basic install error - ob_end_clean()

My colleague has been having some issues with Yii.

He had installed Yii 1.1.4 and run through the requirement checker (all passed) then run the basic yiic webapp demo command.

After that rather than getting the basic web app in a browser he got an error :

Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete. in D:\htdocs\yii\framework\base\CErrorHandler.php on line 99

He’s reverted back to 1.1.2 / tried 1.1.4 again and then tried 1.1.6… all the same error !

I’ve checked his Yii Requirement Checker page and there aren’t even any warnings - all passed.

Any suggestions ? (It’s all working fine on my machine under 1.1.4 and I’m edging closer to finishing chpter 9 - starting to understand a bit more :) )

Thanks

Ed


( ! ) Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete. in D:\htdocs\yii\framework\base\CErrorHandler.php on line 99

Call Stack

Time Memory Function Location

1 0.0004 346560 {main}( ) …\index.php:0

2 0.0138 1871784 CApplication->run( ) …\index.php:13

3 0.0139 1871784 CWebApplication->processRequest( ) …\CApplication.php:155

4 0.0154 2063776 CWebApplication->runController( ) …\CWebApplication.php:121

5 0.0184 2462120 CController->run( ) …\CWebApplication.php:328

6 0.0191 2497304 CController->runActionWithFilters( ) …\CController.php:257

7 0.0191 2497304 CController->runAction( ) …\CController.php:278

8 0.0191 2497304 CInlineAction->run( ) …\CController.php:300

9 0.0191 2497952 SiteController->actionIndex( ) …\CInlineAction.php:57

10 0.0191 2498000 CController->render( ) …\SiteController.php:32

11 0.0232 3024080 CBaseController->renderFile( ) …\CController.php:748

12 0.0233 3024144 CBaseController->renderInternal( ) …\CBaseController.php:88

13 0.0235 3069384 require( ‘D:\htdocs\demo4\protected\views\layouts\column1.php’ ) …\CBaseController.php:119

14 0.0262 3280376 CBaseController->endContent( ) …\column1.php:7

15 0.0262 3280440 CBaseController->endWidget( ) …\CBaseController.php:294

16 0.0262 3280392 COutputProcessor->run( ) …\CBaseController.php:199

17 0.0262 3240088 CContentDecorator->processOutput( ) …\COutputProcessor.php:45

18 0.0262 3240088 CContentDecorator->decorate( ) …\CContentDecorator.php:56

19 0.0265 3240392 CBaseController->renderFile( ) …\CContentDecorator.php:78

20 0.0265 3240456 CBaseController->renderInternal( ) …\CBaseController.php:88

21 0.0268 3302640 require( ‘D:\htdocs\demo4\protected\views\layouts\main.php’ ) …\CBaseController.php:119

22 0.0274 3305408 CModule->__get( ) …\CModule.php:0

23 0.0275 3305408 CModule->getComponent( ) …\CModule.php:86

24 0.0289 3492800 CWebUser->init( ) …\CModule.php:372

25 0.0305 3593616 CHttpSession->open( ) …\CWebUser.php:163

26 0.0305 3593648 session_start ( ) …\CHttpSession.php:100

27 0.0305 3594168 CApplication->handleError( ) …\CApplication.php:0

28 0.0343 3753624 CErrorHandler->handle( ) …\CApplication.php:715

29 0.0343 3665104 ob_end_clean ( ) …\CErrorHandler.php:99

PHP Error

A session had already been started - ignoring session_start()

D:\htdocs\yii\framework\web\CHttpSession.php(100)

088 public function getUseCustomStorage()

089 {

090 return false;

091 }

092

093 /**

094 * Starts the session if it has not started yet.

095 */

096 public function open()

097 {

098 if($this->getUseCustomStorage())

099 @session_set_save_handler(array($this,‘openSession’),array($this,‘closeSession’),array($this,‘readSession’),array($this,‘writeSession’),array($this,‘destroySession’),array($this,‘gcSession’));

100 @session_start();

101 }

102

103 /**

104 * Ends the current session and store session data.

105 */

106 public function close()

107 {

108 if(session_id()!==’’)

109 @session_write_close();

110 }

111

112 /**

Stack Trace

#0

D:\htdocs\yii\framework\web\CHttpSession.php(100): session_start()

#1

D:\htdocs\yii\framework\web\auth\CWebUser.php(163): CHttpSession->open()

#2

D:\htdocs\yii\framework\base\CModule.php(372): CWebUser->init()

#3

D:\htdocs\yii\framework\base\CModule.php(86): CModule->getComponent("user")

#4

D:\htdocs\demo4\protected\views\layouts\main.php(34): CModule->__get("user")

29 <?php $this->widget(‘zii.widgets.CMenu’,array(

30 ‘items’=>array(

31 array(‘label’=>‘Home’, ‘url’=>array(’/site/index’)),

32 array(‘label’=>‘About’, ‘url’=>array(’/site/page’, ‘view’=>‘about’)),

33 array(‘label’=>‘Contact’, ‘url’=>array(’/site/contact’)),

34 array(‘label’=>‘Login’, ‘url’=>array(’/site/login’), ‘visible’=>Yii::app()->user->isGuest),

35 array(‘label’=>‘Logout (’.Yii::app()->user->name.’)’, ‘url’=>array(’/site/logout’), ‘visible’=>!Yii::app()->user->isGuest)

36 ),

37 )); ?>

38 </div><!-- mainmenu -->

39

#5

D:\htdocs\yii\framework\web\CBaseController.php(119): require("D:\htdocs\demo4\protected\views\layouts\main.php")

#6

D:\htdocs\yii\framework\web\CBaseController.php(88): CBaseController->renderInternal("D:\htdocs\demo4\protected\views//layouts/main.php", array("<div class="container"> <div id="content"> <h1>Welcome to <i…"), true)

#7

D:\htdocs\yii\framework\web\widgets\CContentDecorator.php(78): CBaseController->renderFile("D:\htdocs\demo4\protected\views//layouts/main.php", array("<div class="container"> <div id="content"> <h1>Welcome to <i…"), true)

#8

D:\htdocs\yii\framework\web\widgets\CContentDecorator.php(56): CContentDecorator->decorate("<div class="container"> <div id="content"> <h1>Welcome to <i…")

#9

D:\htdocs\yii\framework\web\widgets\COutputProcessor.php(45): CContentDecorator->processOutput("<div class="container"> <div id="content"> <h1>Welcome to <i…")

#10

D:\htdocs\yii\framework\web\CBaseController.php(199): COutputProcessor->run()

#11

D:\htdocs\yii\framework\web\CBaseController.php(294): CBaseController->endWidget("CContentDecorator")

#12

D:\htdocs\demo4\protected\views\layouts\column1.php(7): CBaseController->endContent()

2 <div class="container">

3 <div id="content">

4 <?php echo $content; ?>

5 </div><!-- content -->

6 </div>

7 <?php $this->endContent(); ?>

#13

D:\htdocs\yii\framework\web\CBaseController.php(119): require("D:\htdocs\demo4\protected\views\layouts\column1.php")

#14

D:\htdocs\yii\framework\web\CBaseController.php(88): CBaseController->renderInternal("D:\htdocs\demo4\protected\views//layouts/column1.php", array(" <h1>Welcome to <i>My Web Application</i></h1> <p>Congratulatio…"), true)

#15

D:\htdocs\yii\framework\web\CController.php(748): CBaseController->renderFile("D:\htdocs\demo4\protected\views//layouts/column1.php", array(" <h1>Welcome to <i>My Web Application</i></h1> <p>Congratulatio…"), true)

#16

D:\htdocs\demo4\protected\controllers\SiteController.php(32): CController->render("index")

27 */

28 public function actionIndex()

29 {

30 // renders the view file ‘protected/views/site/index.php’

31 // using the default layout ‘protected/views/layouts/main.php’

32 $this->render(‘index’);

33 }

34

35 /**

36 * This is the action to handle external exceptions.

37 */

#17

D:\htdocs\yii\framework\web\actions\CInlineAction.php(57): SiteController->actionIndex()

#18

D:\htdocs\yii\framework\web\CController.php(300): CInlineAction->run()

#19

D:\htdocs\yii\framework\web\CController.php(278): CController->runAction(CInlineAction)

#20

D:\htdocs\yii\framework\web\CController.php(257): CController->runActionWithFilters(CInlineAction, array())

#21

D:\htdocs\yii\framework\web\CWebApplication.php(328): CController->run("")

#22

D:\htdocs\yii\framework\web\CWebApplication.php(121): CWebApplication->runController("")

#23

D:\htdocs\yii\framework\base\CApplication.php(155): CWebApplication->processRequest()

#24

D:\htdocs\demo4\index.php(13): CApplication->run()

2011-02-24 11:13:46 Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o Yii Framework/1.1.6

Hi Ed, thanks for posting.

Few more details, I’m running Zend Server 5.0.4 in Win 7 x64.

Everything used for work perfectly, but I didn’t have time to look at Yii for a while and when I came back to it, it was broken. Bizarrely, upgrading Zend Server made it work for a day, but after that it stopped working again.

Any suggestions would be gratefully appreciated.

Ric

I have reinstalled my computer recently, and after setting up the server etc everything seems to be okay. I am not sure what I broke last time. Perhaps I was playing with too many extensions and directives. I think it was a caching issue.