Friday, November 14, 2008

Trouble shooting

Warning (2): Cannot modify header information - headers already sent by (output started at 


F:\Prj_PHP\1.2.x.x\app\config\routes.php:61) [CORE\cake\libs\controller\controller.php, line 587]


Code | Context



$status	=	"Location: http://localhost/posts/view/1"


header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line 587
Controller::redirect() - CORE\cake\libs\controller\controller.php, line 568
BidsController::add() - APP\controllers\bids_controller.php, line 25
Object::dispatchMethod() - CORE\cake\libs\object.php, line 114
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 259
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 213
[main] - APP\webroot\index.php, line 90


(default) 4 queries took 53 ms



Nr

Query


Error


Affected


Num. rows


Took (ms)



 



I found some tips from internet:



> Well I'm not surely what exactly is going on but I did have a similar

> problem the other day.


> First of all I would recommend keeping DEBUG set to 2 until you've got


> rid of the issue - at least then if there's an error message you'll see


> it.


> My problem was simply some extra whitespace before the <?php tag in my


> controller. The redirect function uses the PHP header function which


> must be called before ANYTHING is sent to the browser. Extra whitespace


> outwith PHP tags in your controller, or in any other file being


> included will prevent the redirect. This a common reason for redirects


> not working.



 



And I finally found it hide in router.php, which have many blank spaces after  ?>

No comments: